Module 2

Module challenge

Putting conditions to work.

A quality check

Write a program that checks a sample. If the temperature is between 20 and 30 (inclusive) and the sample name is not empty, print Valid sample. Otherwise, print Check the sample.

Your task

Quality check

  • Check a sample: temperature between 20-30 inclusive AND name not empty. Print Valid sample or Check the sample.
Remember

• Compare values with operators • Use if, else, and elif • Combine conditions with and, or, not • Write programs that make decisions