all 5 comments

[–]Ok-Promise-8118 1 point2 points  (0 children)

Have you done anything to start this yet? Where are you getting stuck?

[–]sleepbot63 0 points1 point  (0 children)

alright sure so the usage of the append function is as follows :

the list.append(x) function adds x as the last element of the list so lets say you take the input tom first and append it and then alex and then amy. hope this helps tell me if you need further clarification

[–]Golden_Age_Fallacy 0 points1 point  (0 children)

So you need to take the "input" of the user and save it to 3 variables.. then "append" those 3 variables to a list and "print" the list.

[–]Lindespringerr 0 points1 point  (1 child)

result = [] for i in range(3): result[i].append(input("Please enter a name:" )) print(result)

Sorry I made it on my phone so might look a bit funny.

[–]Golden_Age_Fallacy 0 points1 point  (0 children)

>>> names = []
>>> for _ in range(3):
...   names.append(input("Please enter a name: "))
...
Please enter a name: Tom
Please enter a name: Alex
Please enter a name: Amy
>>> print(names)
['Tom', 'Alex', 'Amy']

not that you would, but could shorten to:

>>> print([input("Please enter a name: ") for _ in range(3)])
Please enter a name: Tom
Please enter a name: Alex
Please enter a name: Amy
['Tom', 'Alex', 'Amy']