0% found this document useful (0 votes)
1 views4 pages

4 Python - Practice - Questions CHAPTER 4

The document provides a comprehensive list of Python practice questions categorized into three difficulty levels: Easy, Medium, and Hard. Each category includes exercises related to conditional statements, lists, tuples, and strings, covering a wide range of programming concepts and techniques. This resource is designed to help learners enhance their Python skills through practical application.
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)
1 views4 pages

4 Python - Practice - Questions CHAPTER 4

The document provides a comprehensive list of Python practice questions categorized into three difficulty levels: Easy, Medium, and Hard. Each category includes exercises related to conditional statements, lists, tuples, and strings, covering a wide range of programming concepts and techniques. This resource is designed to help learners enhance their Python skills through practical application.
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

Conditional Statements | Lists & Tuples | Strings

■ Easy ■ Medium ■ Hard

■ Easy Level

Conditional Statements
1. Check whether a number is positive, negative, or zero.
2. Check whether a number is even or odd.
3. Check whether a person is eligible to vote (18+).
4. Find the greater of two numbers.
5. Check whether a year is a leap year.
6. Check whether a number is divisible by 5.
7. Check whether a student passed (marks ≥ 40).
8. Find the largest of three numbers.
9. Check whether a character is a vowel or consonant.
10. Assign grades based on marks.

Lists
1. Create a list and print it.
2. Print the first and last element.
3. Find the length of a list.
4. Add an element using append().
5. Remove an element using remove().
6. Sort a list.
7. Reverse a list.
8. Find the maximum element.
9. Find the minimum element.
10. Check whether an item exists in a list.

Tuples
1. Create a tuple and print it.
2. Print the first element.
3. Find the length of a tuple.
4. Count occurrences of an element.
5. Find the index of an element.
6. Convert a tuple into a list.
7. Convert a list into a tuple.
8. Check whether an element exists in a tuple.
9. Print all tuple elements using a loop.
10. Find the maximum and minimum values.

Strings
1. Take a string input and print it.
2. Find the length of a string.
3. Print the first and last character.
4. Convert to uppercase.
5. Convert to lowercase.
6. Reverse a string.
7. Count vowels.
8. Count spaces.
9. Check whether a word exists in a string.
10. Replace one word with another.

■ Medium Level

Conditional Statements
1. Create a simple calculator using if-elif.
2. Find whether a number is prime.
3. Check whether a number is a palindrome.
4. Find factorial using conditions and loops.
5. Check whether a character is uppercase or lowercase.
6. Determine the season based on month number.
7. Calculate electricity bill based on units.
8. Determine the day of the week from a number.
9. Check whether a triangle is valid.
10. Find the second largest of three numbers.

Lists
1. Count even and odd numbers in a list.
2. Remove duplicates from a list.
3. Find the second largest element.
4. Merge two lists.
5. Find common elements in two lists.
6. Rotate a list by one position.
7. Find the sum of all elements.
8. Separate positive and negative numbers.
9. Count occurrences of each element.
10. Create a list of squares from 1–20.

Tuples
1. Find the second largest element.
2. Merge two tuples.
3. Remove duplicates from a tuple.
4. Find common elements in two tuples.
5. Convert a tuple of strings to uppercase.
6. Count vowels in tuple elements.
7. Find the longest string in a tuple.
8. Sort a tuple.
9. Reverse a tuple.
10. Find frequency of each element.

Strings
1. Check whether a string is a palindrome.
2. Count vowels and consonants.
3. Find character frequency.
4. Remove duplicate characters.
5. Count words in a sentence.
6. Reverse each word in a sentence.
7. Find the longest word.
8. Check whether two strings are equal.
9. Find the most frequent character.
10. Check whether a string contains digits.

■ Hard Level

Conditional Statements
1. ATM Simulation.
2. Banking System Menu.
3. Student Result Management System.
4. Login System with 3 attempts.
5. Railway Ticket Price Calculator.
6. Movie Ticket Booking Logic.
7. Employee Salary Calculation System.
8. BMI Calculator with categories.
9. Loan Eligibility Checker.
10. Smart Attendance System.

Lists
1. Find all duplicate elements.
2. Implement a shopping cart.
3. Create a to-do list manager.
4. Find pairs whose sum equals a target.
5. Matrix addition using nested lists.
6. Matrix multiplication.
7. Inventory Management System.
8. Student Marks Analyzer.
9. Implement Bubble Sort manually.
10. Implement Binary Search manually.

Tuples
1. Student database using tuples.
2. Store employee records.
3. Find highest salary from tuple records.
4. Sort tuple records by marks.
5. Create a contact book using tuples.
6. Analyze sales data stored in tuples.
7. Find average marks from tuple records.
8. Group tuple elements by type.
9. Find duplicate records.
10. Build a mini reporting system using tuples.

Strings
1. Check whether two strings are anagrams.
2. Find the first non-repeating character.
3. String compression (aaabb → a3b2).
4. Validate an email address.
5. Validate a password.
6. Implement Caesar Cipher encryption.
7. Find all substrings.
8. Find the longest palindrome substring.
9. Build a word frequency counter.
10. Create a mini chatbot using string matching.

You might also like