I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
peek a boo

Enter the code below. The program should ask the user for a number (index) and then display “peek a boo” and the name of the person. Add the following –

  • Add three more names to the list.
  • Add line of code to ask for a number and store it in a variable.
  • Edit the line print (names[0]) and replace 0 with the variable you created.
names = ["Sue", "Fred", "Sally"]
print (names[0])

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Information