123k views
0 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.

1 Answer

3 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 Zohreh
by
3.3k points