Professional Documents
Culture Documents
Code in Text:
Screenshot:
2. Code in Text:
#A python program printing the given list in reversed form
LIST = [10, 20, 30 , 40 , 50]
for x in reversed(LIST):
print(x)
Screenshot:
3. Code in Text:
rows = int(input('Enter the number of rows you want: '))
for x in range(0, rows):
z=x+1
for y in range(0, z):
print("*", end=' ')
print('')
i = -1
for x in range(rows, 0, i):
z=x-1
for y in range(0, z):
print("*", end=' ')
print('')
Screenshot: