I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Menu
peek a boo
Every Tom, Dick and Harry
Vending machine
Display names
Array – challenge 1

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 […]

Every Tom, Dick and Harry

Enter the code below. The code will display all of the names in the list. It is not complete. You need to add the following - - Add 5 more names to the list. - change z < ??? to be the size of the new list. - change print (names[????]) to be print( names[z]). […]

Vending machine

The code below is for a simple vending machine. Each item in the list represents a coin. If the coins 20p, 50p and two £1 coins were added, the list would be coins = [20,50,100,100,0,0,0,0,0,0] Change the code below – change coins so it has 5 coins in it. A 50p, two 10p, a 2p […]

Display names

Enter the code below. Make the following changes – Add two more names to the list. Add the code print(myList[2] + “likes pizza”) Print out the person in position 4 of your list. Say that they like curry. Pick one other person from the list. Say that they like salad. You need to log in or […]

Comments are closed.

Information