488,599 views
8 votes
8 votes
A python program that asks the user for four numbers and prints out the first and last number. It must have an array used in it.

User IgorCh
by
2.5k points

1 Answer

24 votes
24 votes

Answer:

numbers = []

for i in range(4):

z = int(input("enter a number: "))

numbers.append(z)

print("First is {} and last is {}".format(numbers[0], numbers[-1]))

Step-by-step explanation:

Now I understand your other question as well! ;-)

User Atiruz
by
3.5k points