I am very new to python and coding in general
So I am testing something to see if it could work
the output is what you would expect, but is there a better and simpler way to do this?
num1 = [1, 2, 3, 4]
num2 = [5, 6, 7, 8]number = input(“Pick a number from 1-4: “)
if int(number) == num1[0]:
print(number + ” ” + str(num2[0]))
elif int(number) == num1[1]:
print(number + ” ” + str(num2[1]))
elif int(number) == num1[2]:
print(number + ” ” + str(num2[2]))
elif int(number) == num1[3]:
print(number + ” ” + str(num2[3]))
loszan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.