Python Practice Problems for Beginners
Topics: Variables, Data Types, Operators, Control Flow
1. Variables, Data Types, and Basic I/O
1. Input and Print:
Ask the user for their name and age, then print a greeting: 'Hello John, you are 25 years old.'
2. Temperature Converter:
Input temperature in Celsius, convert it to Fahrenheit (F = C × 9/5 + 32).
3. Simple Interest Calculator:
Input principal, rate, and time. Calculate simple interest (SI = (P × R × T) / 100).
4. Swapping Variables:
Swap two numbers entered by the user (without using a third variable).
5. Data Type Identifier:
Input a value from the user and print its type.
2. Operators and Expressions (Including Arithmetic)
1. Basic Calculator:
Take two numbers and an operator (+, -, *, /, %) and perform the operation.
2. Area and Perimeter of a Rectangle:
Input length and width, output area and perimeter.
3. Odd or Even Checker:
Input a number and determine whether it is odd or even.
4. Modulus Puzzle:
Given a number, print the last digit using the % operator.
Python Practice Problems for Beginners
Topics: Variables, Data Types, Operators, Control Flow
5. Compound Interest Calculator:
Input principal, rate, and time. Output compound interest (CI = P * (1 + R/100)^T - P).
3. Control Flow (if, elif, else)
1. Positive, Negative, or Zero:
Input a number and check if it's positive, negative, or zero.
2. Largest of Three Numbers:
Input three numbers, print the largest one.
3. Grading System:
Input a mark (0-100), output the grade (A-F).
4. Leap Year Checker:
Input a year and determine if it's a leap year.
5. Vowel or Consonant:
Input a character, check whether it's a vowel or consonant.