AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Ladders and mixed-up lines

Week 7 · 1.4 Conditional statements in text-based programming · 3 lessons
Answers are for parents and teachers.
1
Write a Python program: ask for the temperature of an oven. Below 100 print Cool, below 180 print Warm, and otherwise print Hot.
2
Say what is printed for 9, 10 and 11.
Python
1stars = int(input("Stars? "))
2if stars > 10:
3    print("Top")
4elif stars > 5:
5    print("Middle")
6else:
7    print("Low")
3
Explain the difference between a syntax error and a logic error. Give an example of each from this week.
4
Draw the flowchart for a program that prints Cheap for a price below 5, Fair for a price below 20 and Dear otherwise.
5
A friend writes if, then elif, but forgets the colon after elif. What message will Python show, and does the program start?