0
0
Intro to Computingfundamentals~10 mins

Logical reasoning in daily decisions in Intro to Computing - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check if it is raining and you need an umbrella.

Intro to Computing
if is_raining [1]:
    print("Take an umbrella.")
Drag options to blanks, or click blank then click option'
Ais False
B== True
C!=
Dis None
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' will check for not raining, which is opposite.
Using 'is None' checks for no value, not raining.
2fill in blank
medium

Complete the code to decide if you should carry a jacket based on temperature.

Intro to Computing
if temperature [1] 20:
    print("Carry a jacket.")
Drag options to blanks, or click blank then click option'
A<
B==
C>
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' means carrying a jacket when it's warm.
Using '==' only checks for exactly 20 degrees.
3fill in blank
hard

Fix the error in the code to decide if you should take a break based on tiredness.

Intro to Computing
if tiredness [1] 7:
    print("Take a break.")
Drag options to blanks, or click blank then click option'
A>=
B=>
C<=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=>' causes syntax error.
Using '<=' checks for less tiredness, opposite logic.
4fill in blank
hard

Fill both blanks to create a decision that checks if you should go outside based on weather and time.

Intro to Computing
if weather [1] "sunny" and time [2] 18:
    print("Go outside.")
Drag options to blanks, or click blank then click option'
A==
B>
C<
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' for weather means not sunny, opposite logic.
Using '>' for time means after 6 PM, opposite logic.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps tasks to their priority if priority is above 3.

Intro to Computing
high_priority_tasks = [1]: [2] for [3] in tasks.items() if [2] > 3
Drag options to blanks, or click blank then click option'
Atask
Bpriority
Dtask, priority
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values.
Using 'tasks' as loop variable instead of 'task'.