Essential Python Practice Worksheet for CBSE Class 11: Master Tokens, Loops, Decision Making, and More

Python is a versatile and beginner-friendly programming language that is widely taught in schools. For CBSE Class 11th students, mastering the fundamentals of Python is crucial for both academic success and building a strong foundation for future studies. This worksheet focuses on some key topics—Python Token, Decision Making, Loops, Lists, Tuples, and Dictionaries—which are essential for learning Python at this level.


1. Python Tokens

Python Token refers to the smallest unit in a Python program. Tokens can be divided into the following types:

  • Keywords: Reserved words with special meaning, like if, else, for, etc.
  • Identifiers: Names used for variables, functions, classes, etc.
  • Literals: Constant values like numbers (10), strings ("Hello") or boolean values (True, False).
  • Operators: Symbols that perform operations between variables, such as +, -, *, =.
  • Punctuators: Symbols used for structure, like commas, colons, parentheses.

Practice Questions

  1. List five keywords in Python.
  2. Write a Python statement using at least two operators.
  3. What is the difference between a literal and an identifier? Give examples.

2. Decision Making in Python

Decision-making structures like if, elif, and else help to execute code based on conditions. Here’s an example:

num = 5
if num > 0:
    print("Positive")
elif num == 0:
    print("Zero")
else:
    print("Negative")

Practice Questions

  1. Write a Python program to check whether a number is even or odd.
  2. Modify the following code to check for negative numbers and print “Negative” if found.
   num = int(input("Enter a number: "))
   if num == 0:
       print("Zero")
   else:
       print("Positive")
  1. Write a Python program that checks if a number is divisible by both 3 and 5.

3. Loops in Python

Loops allow us to execute a block of code repeatedly. Python offers for and while loops.

For Loop Example:

for i in range(1, 6):
    print(i)

While Loop Example:

i = 1
while i <= 5:
    print(i)
    i += 1

Practice Questions

  1. Write a Python program to print the first 10 natural numbers using a while loop.
  2. Using a for loop, print the multiplication table of 7.
  3. Write a Python program that prints all numbers between 1 and 100 that are divisible by 4.

4. List in Python

A List is a collection of items that are ordered and changeable. Lists are written with square brackets.

Example:

fruits = ["apple", "banana", "cherry"]
print(fruits[1])  # Output: banana

Practice Questions

  1. Write a Python program to create a list of 5 integers and display the largest number.
  2. Given a list numbers = [10, 20, 30, 40, 50], write a program to replace the third element with 99.
  3. Write a program to append the string “grape” to the following list: fruits = ["apple", "banana", "cherry"].

5. Tuple in Python

A Tuple is similar to a list but is immutable (unchangeable). Tuples are written with parentheses.

Example:

my_tuple = (1, 2, 3)
print(my_tuple[0])  # Output: 1

Practice Questions

  1. Create a tuple with the names of 4 different cities.
  2. Write a program to find the length of a tuple (1, 2, 3, 4, 5).
  3. Given a tuple (10, 20, 30, 40, 50), write a program to access the last two elements.

6. Dictionary in Python

A Dictionary is an unordered, changeable, and indexed collection that stores data in key-value pairs.

Example:

student = {"name": "John", "age": 17, "grade": "11th"}
print(student["name"])  # Output: John

Practice Questions

  1. Write a Python program to create a dictionary with three key-value pairs (name, age, city).
  2. Given the dictionary student = {"name": "John", "age": 17, "class": "11th"}, write a program to update the student’s age to 18.
  3. Create a dictionary where keys are country names and values are their capitals. Add two countries and their capitals to the dictionary.

Conclusion

This Python practice worksheet covers essential topics such as Tokens, Decision Making, Loops, Lists, Tuples, and Dictionaries. These concepts form the foundation of Python programming and are crucial for students in Class 11 to understand. By solving these practice questions, students can reinforce their knowledge and be better prepared for exams and practical assignments.


Encourage students to work on these exercises, as it will help them understand the core concepts of Python and develop logical thinking skills that are important for programming.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *