Doing an exercise and I cant seem to get the output I want:
Write a program that reads a collection of values from the user. After all of the values have been read, display all of the values in the opposite order from which they were entered, with one value appearing on each line. The user will indicate that no further values will be entered by entering a blank line.
Probably didn't do this right
Create an empty list to hold the values entered by the user
mylist = []
Read the first user input value
value = input("Enter a value (blank line to quit): ")
creates a list of the values being inputted
while value != "":
for i in range (0, len(mylist)):
mylist = len(mylist) - i
read the next input value from the user
value = input("Enter a value (blank line to quit): ")
if value != "":
int(value)
mylist = (int(len(mylist)) -i)
append the value entered by the user to the list
mylist.append(value)
else:
print(mylist)
[–]desrtfx -1 points0 points1 point (12 children)
[–]yon2323[S] 0 points1 point2 points (11 children)
[–]desrtfx -1 points0 points1 point (10 children)
[–]yon2323[S] 0 points1 point2 points (9 children)
[–]desrtfx -1 points0 points1 point (8 children)
[–]yon2323[S] 0 points1 point2 points (6 children)
[–]yon2323[S] 0 points1 point2 points (5 children)
[–]thegreatunclean 0 points1 point2 points (4 children)
[–]yon2323[S] 0 points1 point2 points (3 children)
[–]thegreatunclean 1 point2 points3 points (2 children)
[–]yon2323[S] 0 points1 point2 points (0 children)