What’s your favourite subject? I hope it’s coding!
In the editor below, fill in the blanks (________
) so that the program asks the user for their favourite subject, and if it’s coding, print back Hey, fellow programmer!
according to the flowchart below:
Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:
Art is my favourite subject!
onto the screen. If the user types coding
for their subject, then the program should print Hey, fellow programmer!
before it prints Art is my favourite subject!
.if
statements in Python! Everything “inside” the if
statement has to line up, and don’t forget the colon (:
) at the end of the if
statement!Below is an example of how the program should run:
Enter your favourite subject: english
Art is my favourite subject!
Enter your favourite subject: coding
Hey, fellow programmer!
Art is my favourite subject!
Need some help? Click here to reveal a video walkthrough for this task!
You must be logged in to post a comment.