Conditionals

Booleans and if-else statements in Python

Description

Using Python, write a script to ask the user for input, then respond based on that input.

Student Task

This task is designed to assess whether you understand how to run different pieces of code based on a given value.

You may use web search to complete this task, but you may not refer to your own previous work. This is to demonstrate that you can solve a task using publicly available resources.


  1. Create a new script called conditionals.py.

  2. Prompt the user to enter how many coffees they had today.

  3. Respond accordingly:
  4. Make sure the program doesn’t crash if an invalid value is entered.


Note: You may use the web as a reference for this task, including the Python documentation and StackOverflow. You may not refer to your own previous work, even if it is hosted on GitHub.

View Assessor Guide

Assessor Checklist