This repository contains beginner-friendly Python practice questions covering essential programming fundamentals.
Q1: Print "Hello, Python!"
Expected Output:
Hello, Python!
Q2: Display your name using the print() function.
Expected Output:
My name is Om
Q3: Create a Python program that prints the result of 5 + 7.
Expected Output:
12
Q4: Write a simple Python program that prints โIโm learning Python!โ.
Expected Output:
Iโm learning Python!
Q5: Assign a value to a variable and print it.
Expected Output:
Python is awesome
Q6: Write a single-line statement to print the sum of 10 and 20.
Expected Output:
30
Q7: Write a program with a single-line comment and print a message.
Expected Output:
This is a Python comment example
Q8: Write a program that uses a multi-line comment.
Expected Output:
Multi-line comment example
Q9: Create a variable x with value 50 and print it.
Expected Output:
50
Q10: Assign your name to a variable and print: โHello, โ.
Expected Output:
Hello, Om
Q11: Print the type of the variable containing value 25.
Expected Output:
<class 'int'>
Q12: Create variables of different types and print their types.
Expected Output:
<class 'int'>
<class 'str'>
<class 'float'>
<class 'bool'>
Q13: Add two integers and print the result.
Expected Output:
15
Q14: Find the square of a number.
Expected Output:
49
Q15: Convert the string โ10โ into an integer and print it.
Expected Output:
10
<class 'int'>
Q16: Convert integer 5 into a float and print it.
Expected Output:
5.0
<class 'float'>
Q17: Print your favorite quote inside double quotes.
Expected Output:
"Code is like humor. When you have to explain it, itโs bad."
Q18: Print the length of the string "Python".
Expected Output:
6
Q19: Print the result of 10 > 5.
Expected Output:
True
Q20: Print the result of 7 == 9.
Expected Output:
False
Q21: Perform addition, subtraction, multiplication, and division on two numbers.
Expected Output:
15
5
50
2.0
Q22: Use the modulus operator to find the remainder when 10 is divided by 3.
Expected Output:
1
Q23: Create a list of 3 fruits and print it.
Expected Output:
['apple', 'banana', 'cherry']
Q24: Add a new fruit to the list and print it.
Expected Output:
['apple', 'banana', 'cherry', 'mango']
Q25: Create a tuple of colors and print it.
Expected Output:
('red', 'green', 'blue')
Q26: Access the first element of the tuple.
Expected Output:
red
Q27: Create a set of unique numbers.
Expected Output:
{1, 2, 3, 4, 5}
Q28: Add a number to the set and print it.
Expected Output:
{1, 2, 3, 4, 5, 6}
Q29: Create a dictionary with your name and age.
Expected Output:
{'name': 'Om', 'age': 20}
Q30: Access and print your age from the dictionary.
Expected Output:
20
Q31: Check if a number is positive or negative.
Expected Output:
Positive number
Q32: Write a program to check if a number is even or odd.
Expected Output:
Even number
This beginner-friendly set is perfect for hands-on Python fundamentals practice.
Happy Coding! ๐โจ