0% found this document useful (0 votes)
2 views2 pages

Python Practice Questions

The document contains a series of Python practice questions categorized by difficulty level, focusing on fundamental programming concepts such as variables, lists, tuples, sets, and dictionaries. Each question provides specific tasks for users to perform, such as calculating sums, finding maximum values, and checking for the existence of elements. Additionally, there is a bonus question that involves creating a mini result system to evaluate student grades based on their marks.

Uploaded by

emaanfatima2069
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)
2 views2 pages

Python Practice Questions

The document contains a series of Python practice questions categorized by difficulty level, focusing on fundamental programming concepts such as variables, lists, tuples, sets, and dictionaries. Each question provides specific tasks for users to perform, such as calculating sums, finding maximum values, and checking for the existence of elements. Additionally, there is a bonus question that involves creating a mini result system to evaluate student grades based on their marks.

Uploaded by

emaanfatima2069
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 PRACTICE QUESTIONS (BASICS)

1. Variables (Easy)
Take two numbers from user and print:
- Sum
- Difference
- Multiplication
- Division

------------------------------------------------------------

2. Variables (Medium)
Take 3 subject marks from user and:
- Calculate total
- Calculate average
- If average >= 50 → print "Pass"
- Else → print "Fail"

------------------------------------------------------------

3. List (Easy)
Create a list of 5 numbers.
- Print first number
- Print last number
- Print length of list

------------------------------------------------------------

4. List (Medium)
Take 5 numbers from user and store in list.
- Print maximum number
- Print minimum number
- Print sum of all numbers

------------------------------------------------------------

5. List (Hard)
Take 6 numbers in list.
Print only EVEN numbers using loop.

Example:
Input: [1,2,3,4,5,6]
Output: 2 4 6

------------------------------------------------------------

6. Tuple (Easy)
Create a tuple of 5 cities.
Check if "Lahore" exists in it.
If yes → print "Found"
Else → print "Not Found"

------------------------------------------------------------

7. Tuple (Medium)
Create a tuple of numbers.
Count how many times number 5 appears.
Example:
(1,5,3,5,7,5)
Output: 3

------------------------------------------------------------

8. Set (Medium)
Create two sets:
A = {1,2,3,4,5}
B = {4,5,6,7}

Print:
- Union
- Intersection
- Difference (A - B)

------------------------------------------------------------

9. Dictionary (Medium)
Create a dictionary:
Subject → Marks (3 subjects)

Print:
- Total marks
- Highest marks

------------------------------------------------------------

10. Dictionary + List (Hard)


Take 3 students name from user.
For each student:
- Take marks
- Store in dictionary

Then:
- Print all students
- Print topper name

------------------------------------------------------------

BONUS (Optional)
Make a mini result system:
- Ask name
- Ask 3 subject marks
- Store in dictionary
- Calculate total + average
- Print grade:
90+ → A
80+ → B
70+ → C
Below → Fail

You might also like