0% found this document useful (0 votes)
3 views1 page

Simple Practice Questions For Python Programming Week 1

The document provides simple practice questions for Python programming, focusing on basic control structures and input validation. It includes tasks such as checking if a number is even or odd, validating student test scores, monitoring temperature limits, categorizing grades based on scores, and implementing a safety protocol for pipeline pressure. Each task outlines specific requirements and expected outputs for the programs to be written.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Simple Practice Questions For Python Programming Week 1

The document provides simple practice questions for Python programming, focusing on basic control structures and input validation. It includes tasks such as checking if a number is even or odd, validating student test scores, monitoring temperature limits, categorizing grades based on scores, and implementing a safety protocol for pipeline pressure. Each task outlines specific requirements and expected outputs for the programs to be written.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Simple Practice Questions For Python Programming Week 1


​1. The Even or Odd Checker
​The Task: Write a program that asks the user to input a number. Use an if statement to check if
the number is even or odd, and print the result.

​ . The Passing Grade Validator


2
​The Task: Write a program that asks for a student's test score (out of 100). If the score is 50 or
higher, print "Congratulations, you passed!" Otherwise, print "Keep practicing, you'll get it next
time!"

​ . Basic Temperature Alarm


3
​The Task: A piece of machinery should not exceed a temperature of 85°C. Write a program that
takes a temperature as input. If it is over 85, print "ALARM: Temperature too high! Shutting
down." If it is exactly 85, print "WARNING: Maximum operating temperature reached."
Otherwise, print "Temperature normal."

​4. The UI CGPA Categorizer
​The Task: Write a program that takes a student's final score (0-100) and outputs their
corresponding grade based on the standard grading system:
​70 - 100: A
​60 - 69: B
​50 - 59: C
​45 - 49: D
​0 - 44: F
​Bonus constraint: If the user enters a number less than 0 or greater than 100, print "Invalid
score entered. Please enter a number between 0 and 100."

​ . Offshore Pipeline Safety Protocol


5
​The Task: You are designing a basic safety monitor for a pipeline. Your program needs to check
two inputs: pressure_level (in psi) and valve_status (either "open" or "closed").
​If the pressure is above 5000 psi and the valve is "closed", print: "CRITICAL DANGER: Open
valve immediately to relieve pressure!"
​If the pressure is above 5000 psi but the valve is "open", print: "Warning: High pressure
detected, but system is venting."
​If the pressure is 5000 psi or below, print: "System stable."

You might also like