Copy a challenge in to a Python editor (IDLE or Trinket) and attempt to solve the challenge
# 1. Write a program that asks the user for a number, and then calculates its square using
# the formula: square = number * number
# 2. Write a program that asks the user for a number, and then calculates its cube using the
# formula: cube = number * number * number.
# 3. Write a program that takes in two numbers, multiplies them and displays the result
# 4. Write a program that takes in three numbers, adds them together
# and then displays their sum.
# 5. Write a program that takes in two numbers, divides them and displays the result.
# 6. Write a program that asks the user for the radius of a circle, and then calculates its circumference using the formula: circumference = 2 * pi * radius.
# 7. Write a program that takes in two numbers, divides them
# and displays the integer and remainder results. e.g. 7 / 3 = 2 r 1.
# 8. Write a program that takes in the user's name and then displays a
# message to that person. e.g. "Hello, Mikey".
# 9. Write a program that takes in the two seperate names and then displays both names and
# says they are friends.
# 10. Write a program that takes in a number, and then displays the times table for that
# number. e.g. 7 is input. 7, 14, 21, 28, 35, 42, 49, 56, 63, 70 is output.
# 11. Write a python program that calculates the area and perimeter of a rectangle.
# 12. Write a program that asks the user for a temperature in Celsius, and then converts it to
# Fahrenheit using the formula: F = (C * 1.8) + 32.
# 13. You have found a summer job in a local farm picking apples. You are paid in two ways,
# by weight and by time. You are paid £0.50 for every kilogram picked and £8.50 for every
# hour worked. Enter the weight and hours worked along with a calculation for each wage.
# Display both earnings and declare the actual earnings.
# 14. You work at Zara. You earn 12.45 per hour. You also earn 2% commission on top of your
# pay based on sales that day. Write a program that takes in the number of hours you worked,
# and the value of items sold. It must calculate and display your wage, commission and
# total pay.
# 15. Write a program that helps the user to add up the coins in their piggy bank.
# The program should ask: “How many pennies”, “How many two pences”, “How many 5
# pences” etc. Then it should give the total value of the piggy bank.
# 16. Write a program that takes in a number and displays whether it is a positive
# or a negative number.
# 17. Write a program that takes in two numbers and displays the bigger one.
# 18. Write a program that takes in a number and displays whether it is an odd
# or an even number.
# 19. Write a program that takes in a person's age and then displays whether they
# are allowed to buy alcohol or not.
# 20. Write a python program that asks the user for their age and determines if they are old
# enough to vote.
# 21. Write a program that takes in a person's age and then displays whether they
# are allowed to watch a 12, 15 or 18 certificat movie.
# 22. Write a program that takes in a student mark out of 100 and then displays the
# grade that student would get. You can research "GCSE Computer Science grade boudaries"
# to get some real context for these boundaries.
# 23. Write a program that asks a user to enter a number. If the number is between 0 and
# 10, write the word blue. If the number is between 10 and 20, write the word red.
# If the number is between 20 and 30, write the word green. If it is any other number,
# write that it is not a correct colour option.
# 24. Write a program that that performs the following: gets the temperature of a bath.
# If the bath is 39 or hotter, display “Too hot”. If the bath is 28 or lower, display
# “too cold”. Otherwise, show “Just right”.
# 25. Write a program that takes two user inputs, the cost of a product and the sales price.
# The program should output whether that product is making a profit or a loss, and display
# how much by.
# 26. ASOS is having a sale. They will offer a 20% discount when users spend more than £100
# and they get free delivery if they spend over £50 (postage usually costs £4). Write a
# program that takes the ammount of money a user is spending, and then display the total
# for that user to pay.
# 27. Write a program that takes in a persons name and the year they were born, and
# then prints only the first 3 characters of their name followed by the two digit year they
# were born. e.g. Mikey Skilton, 1990 will turn into -> Mik90
# 28. Write a program that displays numbers 1 to 10 (use a for loop).
# 29. Write a program that displays numbers 100 down to 0 (use a for loop).
# 30. Write a program that displays all even numbers up to 100 (use a for loop).
# 31. Write a program that shows the 7 times table (use a for loop). e.g. 7, 14, 21...
# 32. Write a program that takes in a number and displays it's times table up to 12.
# Each times table on the output should look pretty, e.g. 7 x 5 = 35 (use a for loop)
# 33. Use this list of data:
# names = ["Moanna", "Rapunzel", "Cinderella", "Prince Charming", "Beast"]
# Write a program that prints each of these names out one above the other (use a for loop).
# 34. Use this list of data:
# primes = [2,3,5,7,11,13,17,19]
# Write a program that prints the double of each of these numbers (use a for loop).
# 35. Use this string:
# word = supercalifragilisticexpialidocious
# Write a program that prints ONLY the vowels of this word. e.g a,e,i,o,u (use a for loop)
# 36. Make a shopping list program that enables users to enter items repeately until
# they enter "stop". The program will then print out all of their items (use a for loop).
# 37. You are making posters of times tables to go around a primary school classroom.
# Write a program that displays all times tables from 1 to 12 for all numbers from 1 to 12.
# Seperate each distinct number with a line break (use a for loop).
# 38. Write a program that enables users input their password to access a system. The users get only 3
# attempts and then they are locked out. The actual password is "password123" (use a for loop).
# 39. Write a program that displays numbers 1 to 10 (use a while loop).
# 40. Write a program that displays numbers 100 down to 0 (use a while loop).
# 41. Write a program that displays all even numbers up to 100 (use a while loop).
# 42. Write a program that shows the 7 times table (use a while loop).
# 43. Write a program that asks the user to enter a password, and keeps asking until the correct password is entered.
# 44. Write a program that asks the user for a number and then prints all the numbers up to that number using a while loop.
# 45. Write a program that asks the user to guess a number between 1 and 100, and keeps asking until the correct number is guessed.
# 46. Write a program that asks the user for a string and then prints each character of the string on a new line using a while loop.
# 47. Write a program that asks the user for a list of numbers and then calculates the sum of those numbers using a while loop.
# 48. Write a program that prints the first 10 odd numbers using a while loop.
# 49. Write a program that asks the user for a list of numbers and then calculates the product of those numbers using a while loop.
# 50. Write a program that asks the user for a list of names and then prints each name with a greeting message using a while loop.
# 51. Write a program that asks the user for a number and then calculates the factorial of that number using a while loop.
# 52. Write a program that asks the user to enter a sequence of numbers and then calculates the average of those numbers using a while loop.
# 53. Write a program that creates a list of numbers from 1 to 10, and then prints each number on a new line.
# 54. Write a program that asks the user to enter a list of numbers, and then prints the largest number in the list.
# 55. Write a program that asks the user to enter a list of names, and then prints the number of names that start with the letter "A".
# 56. Write a program that asks the user to enter a list of numbers, and then prints the sum of all the even numbers in the list.
# 57. Write a program that creates a list of 10 random numbers, and then prints the list in ascending order.
# 58. Write a program that creates a list of 5 words, and then prints each word in reverse order.
# 59. Write a program that asks the user to enter a list of words, and then prints the list in alphabetical order.
# 60. Write a program that asks the user to enter a list of numbers, and then removes all the even numbers from the list.
# 61. Write a program that creates a list of 10 random numbers, and then prints the second largest number in the list.
# 62. Write a program that asks the user to enter a list of numbers, and then calculates the average of the numbers in the list.
# 63. Write a program that asks the user for two numbers, and then uses a procedure to add the numbers together and print the result.
# 64. Write a program that asks the user for a list of numbers, and then uses a procedure to calculate the sum of the numbers and print the result.
# 65. Write a program that asks the user for a string, and then uses a procedure to print the string in reverse order.
# 66. Write a program that asks the user for a list of numbers, and then uses a procedure to print only the even numbers in the list.
# 67. Write a program that asks the user for a list of names, and then uses a procedure to print a greeting message for each name.
# 68. Write a program that asks the user for a list of numbers, and then uses a function to return and print the numbers in reverse order.
# 69. Write a program that asks the user for a number, and then uses a function to return and print the multiplication table for that number.
# 70. Write a program that asks the user for a list of words, and then uses a function to return and print only the words that contain the letter "a".
# 71. Write a program that asks the user for a list of numbers, and then uses a function to return the product of the numbers and print the result.
# 72. Write a program that asks the user for a list of names, and then uses a function to return and print only the names that start with the letter "A".
# 73. Write a program that reads a text file and prints its contents to the console.
# 74. Write a program that reads a list of numbers from a text file, calculates the average of the numbers, and writes the result to another text file.
# 75. Write a program that reads a list of words from a text file, sorts the words in alphabetical order, and writes the sorted words to another text file.
# 76. Write a program that reads a list of numbers from a text file, removes any duplicates in the list, and writes the unique numbers to another text file.
# 77. Write a program that reads a list of names from a text file, capitalizes the first letter of each name, and writes the capitalized names to another text file.
# 78. Write a program that reads a list of words from a text file, counts the number of occurrences of each word, and writes the results to another text file.
# 79. Write a program that reads a list of numbers from a text file, finds the smallest number in the list, and writes the result to another text file.
# 80. Write a program that reads a list of names from a text file, removes any names that start with the letter "A", and writes the remaining names to another text file.
# 81. Write a program that reads a text file, replaces all occurrences of a specified word with another word, and writes the updated text to another text file.
# 82. Write a program that reads a list of numbers from a text file, calculates the sum of the numbers, and writes the result to another text file.