1.14. Additional Challenges#
Code challenge: Python’s Awesome!
You have been provided with some code.
Print('Python's awesome!')
The code should say Python’s awesome! However, the code has some bugs!
Debug this code!
The output of your program should look like this:
Python's awesome!
Solution
Solution is locked
Code challenge: 30% off!
Today is your lucky day! Your favourite store is having a sale where everything is discounted by 30%! However, the discount isn’t applied until checkout.
Write a program that asks the user for the original price and then gives the discounted price to 2 decimal places.
Example 1
Enter the price ($): 10
$7.00
Example 2
Enter the price ($): 79.99
$55.99
Solution
Solution is locked
Code challenge: Favourite Foods
Write a program that asks for the user’s top 3 favourite foods and then returns the results as per the examples below.
Example 1
What are your 3 favourite foods?
chocolate
ice cream
cake
Your top 3 favourite foods are:
1. chocolate
2. ice cream
3. cake
Example 2
What are your 3 favourite foods?
pasta
eggs
mushrooms
Your top 3 favourite foods are:
1. pasta
2. eggs
3. mushrooms
Example 3
What are your 3 favourite foods?
pineapples
peaches
lemons
Your top 3 favourite foods are:
1. pineapples
2. peaches
3. lemons
Solution
Solution is locked