Intermediate while loop problems
The array below contains a mighty number! The greatest of them all! Your task is to write a while loop to find it. Note – You can not use the max() function. Your goal is to write max()! You need to log in or create an account to submit code!
You know the story. Your stuck at work and then your boss yells at you for not working out the average spend of customers for the last week. But fear not python will rush to your rescue with the ultimate in average coding wonder! spendArray = [3.12, 9.54, 8.11, 20.34, 16.71, 19.11] count = 0 […]
When in Rome you should do what the Romans do. That is the advice we want to give! However if people are from somewhere else then we just want to ignore them and ask again! So a sample output from the program may look like this – Where are you? London Where are you? Paris […]
Create a program which will emulate two die being rolled and print the value of each dice.Add an option to roll again or quit the program after each die roll. Start by researching how to generate random numbers in Python. HINT – you will need to import random You need to log in or create an account […]
There is a killer on the loose! But fear not the police know who it is. They need to access the police database for their details. killers = ["Bert", "Sam", "Sue", "Fiona", "Dave", "Pete", "Charlotte", "Martin"] You must write a program which will perform a serial search over the above array. The police should be […]
You are to write a program which will show just how much your computer loves you! When run the program will display a “[” symbol, followed by a random number of “-” and ending with a “]”. For example a couple of runs of the program might produce. This is how much I love […]
You are to create a game of dice. The game works like this – The player rolls two dice If the dice have the same value (eg 2,2 or 5,5) then they win! If the dice do not have the same value they loose. This is going to be a betting game. The user starts […]
Allow the user to enter any number. You have to test to see if it is a prime number or not. A prime number is one which divides cleanly by 1 and itself only. For example 7 is a prime number. To test if a number is prime you must test every number from 2 […]
A number palindrome is a number which, when read from left to right is the same as when you read it from right to left. For example 7667, 44, 242,876678 You are to write a program which will – Allow a number to be entered Find the NEXT biggest number palindrome. Output that number. For […]