Notifications
Clear all

Python program to create a list of 10 integer elements. copy all the elements to a new list in reverse order

   RSS

0
Topic starter

Output Example:
[10,25,20,35]

[35,20,25,10]

2 Answers
0
Topic starter

# using function

i=10

lst=[]

while(i>0):

    n=int(input('enter any number: '))

    lst.append(n)

    i=i-1

print(lst)

lst.reverse()

lst1=lst

print(lst1)

0
Topic starter

# without function

i=10

lst=[]

while(i>0):

    n=int(input('enter any number: '))

    lst.append(n)

    i=i-1

i=-1

lst1=[]

while(i>-11):

    lst1.append(lst[i])

    i=i-1

print(lst1)

Share: