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

Essential Python Programs for Beginners

The document contains a list of Python programming tasks that cover basic operations, condition checks, and user input handling. It includes examples such as arithmetic operations, comparison checks, logical operators, and creating a simple calculator. Additionally, it features programs for determining grades, checking even/odd numbers, and providing driving instructions based on signal colors.
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)
5 views1 page

Essential Python Programs for Beginners

The document contains a list of Python programming tasks that cover basic operations, condition checks, and user input handling. It includes examples such as arithmetic operations, comparison checks, logical operators, and creating a simple calculator. Additionally, it features programs for determining grades, checking even/odd numbers, and providing driving instructions based on signal colors.
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

PYTHON PROGRAMS

1. Write a Python program to store two numbers in variables and display their addition and subtraction.
2. Write a Python program to store two numbers and check whether the first number is greater than the
second and whether both numbers are equal.
3. Write a Python program to use AND and OR operators to check conditions on two numbers and print
the result.
4. Write a Python program to add a value to a number using the assignment operator and display the
updated result.
5. Write a Python program to check whether a given fruit name is equal to “apple” or “grape” using
comparison operators.
6. Write a Python program to take two numbers from the user and display their subtraction and
division results.
7. Write a Python program to take a number from the user and use the NOT operator to check whether
the number is greater than 0.
8. Write a Python program to take two numbers from the user and find the remainder using the modulus
(%) operator.
9. Write a Python program to take two values from the user and check whether both values are the same
or not using is and is not operators.
10. Write a Python program to create a simple calculator that takes two numbers and an operator from the
user and performs the selected operation using match-case.
11. Write a Python program that shows a menu to calculate the area of a square, rectangle, or circle and
displays the area based on the user’s choice using match-case.
12. Write a Python program to take marks from the user and display the grade using the match-case
statement as per the following rules:
 If the marks are 90 or above, display "Grade A".
 If the marks are between 80 and 89, display "Grade B".
 If the marks are between 70 and 79, display "Grade C".
 If the marks are anything lower than 70, display "Fail".
13. Write a program that asks the user to enter a number and determines if it is Even or Odd.
14. Write a program that asks the user to enter a month number (from 1 to 12) and tells them how many
days that month has.
15. Write a program that asks the user to enter a signal color (Red, Yellow, or Green) and gives the
correct driving instruction.
 If the color is "red", display "Stop".
 If the color is "yellow", display "Get Ready".
 If the color is "green", display "Go".
 If the user types anything else, display "Invalid signal".
16. Write a program that asks for the total bill amount and tells the customer how much of a discount they
get based on these spending levels:
 10% Discount: If the bill is between 5,000 and 10,999.
 5% Discount: If the bill is between 3,000 and 4,999.
 No Discount: If the bill is less than 3,000.

You might also like