This text covers approximately 80% of the CBSE Class 11 CS theory syllabus. Make sure to practice writing Python code on paper (as required by CBSE board exams) and memorize the ASCII values (0=48, A=65, a=97) and Boolean logic truth tables.
if num == rev: print(num, "is a Palindrome") else: print(num, "is not a Palindrome") computer science cbse class 11
# Using range(start, stop, step) for i in range(1, 11): # 1 to 10 print(i, "squared =", i**2) for char in "Python": print(char) # Prints P, y, t, h, o, n This text covers approximately 80% of the CBSE
num = int(input("Enter a number: ")) temp = num rev = 0 while temp > 0: digit = temp % 10 rev = rev * 10 + digit temp = temp // 10 Use when iterations are unknown
# Simple if if marks >= 33: print("Pass") if marks >= 90: grade = "A" else: grade = "B" if-elif-else ladder if marks >= 90: grade = "A+" elif marks >= 75: grade = "A" elif marks >= 60: grade = "B" else: grade = "Fail" 4.2 Loops (Iteration) while loop: Repeats as long as condition is true. Use when iterations are unknown.
count = 1 while count <= 5: print("Hello", count) count += 1 # Increment to avoid infinite loop Used to iterate over a sequence (string, list, range). Use when iterations are known.