1

Here is what i am trying to do.. I want the user to pick a number, and then print word from my list that the number indexes. This is what i have so far

mylist = ["john","jack","jen","judy","jill"]
mylist
add = input("please state a name")
mylist.append(add)
print (mylist)
add = input("please state a number")
Joshua Aranda
  • 11
  • 1
  • 1
  • 5

1 Answers1

1

This would work:

index = input("please state a number")
index = int(index)
name = mylist[index]
print(name)
spg
  • 9,309
  • 4
  • 36
  • 41