This python program allows user to enter the length of a List.
Code:
NumList = []
Number = int(input("Total Number of List Elements: "))
for i in range(1, Number + 1):
value = int(input("Element %d : " %i))
NumList.append(value)
NumList.reverse()
print("\nThe Result of a Reverse List = ", NumList)
Output:
Read More:
The Tech Platform
Comentarios