python program to print
1
23
456
78910
1112131415
Answers
Answered by
1
Answer:
Following python program ask from user to enter side length of square to print area of the square:
# Python Program - Calculate Area of Square print("Enter 'x' for exit."); side = input("Enter side length of Square: "); if side == 'x': exit(); else: side_length = int(side); area_square = side_length*side_length; print("\nArea of Square =",area_square
Answered by
1
Answer:
If the question is to print the following pattern:
rows = int(input("enter no of rows")) # Rows you want in your pattern
initialColumns = 2
startingNumber = 1
for i in range(rows):
for column in range(1, initialColumns):
print(startingNumber, end=' ')
startingNumber += 1
print("")
initialColumns += 1
Similar questions