Construct Number Partern


3. Write a Python program to construct the following pattern, using a nested loop number.

#1                                 
#22  
# 333  
# 4444 
# 55555 
# 666666   
# 7777777       
# 88888888 
# 999999999 

# Solution number.


for i in range(10):
    print(str(i) * i)

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...