Intermediate array problems
Name Test Score 1 Test Score 2 Susan 15 17 Rowan 14 18 Peter 15 11 Jack 12 14 Write a program to store the above into an array. You will need to use a 2 dimensional array or three seperate arrays to complete the task.Secondly you must write a while loop which will print out everyone’s total […]
We can easily find out how big an array is by using the len() function. However how many bytes does it take up in memory. That is a much more difficult problem. A string uses one byte (well 2 if it is unicode, but we will assume ascii!) per character. So the string “hello” has […]
You are to create a program which, when run, will give you an inspring quote at random. You can get some ideas from – http://www.inspirational-quotes.info/ You should have at least 20 quotes to make the program useful! You need to log in or create an account to submit code!
You are to write a program which will answer any question! Below is an example of how the 8 ball works. http://www.indra.com/cgi-bin/spikes-8-ball You should have a list of possible answers (they are up to you!). Have a look at the example to get an idea of what those answers could be. You need to log […]
Create an array (or arrays) with one word in each cell: head, shoulders, knees, toes, eyes, ears, mouth, nose. Use a loop (or loops) to step through the array and print the lyrics of a well known children’s rhyme. Use a another loop to repeat the lyrics. Step through the array in the rhythm of […]
You are to play the duck song (above) and get the lyrics to display at the correct time. Below is some code to get you started.You will need to have pygame installed and download the duck song to get this code to work. http://www.pygame.org/download.shtml import time from pygame import mixer # Load the required library […]