Class 11 CS & Ip Worksheets
Class 11 CS & Ip Worksheets
Class 11 CS & Ip Worksheets
1, ARAKKONAM
WORK SHEET - Class XI
Computer Science 083
GETTING STARTED WITH PYTHON
Very Short answer Type Questions
Q.1 When was Python released?
PYTHON FUNDAMENTALS
Very Short answer Type Questions
Q.1 What is None literal in Python?
Q.2 What is the error in following code: x, y =7 ?
Q.3 what will the following code do: a=b=18 ?
Q.4 Following code is creating problem X = 0281, find reason.
Q.5 Find the error in the following code:
(a) temp=90 (b) a=12 (c) print(“x=”x)
Print temp b=a+b
print( a And b)
(d) a, b, c=2, 8, 4 (e) x = 23 (f) else = 21-4
print(a, b, c) 4=x
c, b, a = a, b, c
print(a; b; c)
Q.6 Find the error in the following code:
(a) y = x +5 (b) a=input(“Value: “) (c) print(x = y = 5)
print(x,y) b = a/2
print( a, b)
Short Answer Type Questions
Q.1 What is the difference between a keyword and an identifier?
Q.2 What are literals in Python? How many types of Literals allowed in Python?
Q.3 How many types of sequences are supported in Python?
Q.7 What are operators? What is their function? Give examples of some
unary and binary operators.
Q.8 What is block/code block/suit in Python?
Q.9 What is the role of indentation in Python?
Q.10 How many types of strings are supported by Python?
Skill Based Questions
Q.4 What is the error in following Python program with one statement?
print(“My name is : “, name)
suggest a solution
Q.5 Predict the output of the following:
Q.7 Write a Program to obtain temperature in Celsius and convert it into Fahrenheit using
formula –
C X 9/5 + 32 = F
Q.8 Predict output:
Q.9 WAP to read todays date (only date Part) from user. Then display how many days are
left in the current month.
Q.10 WAP to print the area of circle when radius of the circle is given by user.
Q.11 WAP to print the volume of a cylinder when radius and height of the cylinder is given
by user.
Q.12 What is the error in following Python program with one statement?
print(“My name is : “, name)
suggest a solution
Q.13 Predict the output of the following:
Q.15 Write a Program to obtain temperature in Celsius and convert it into Fahrenheit using
formula –
C X 9/5 + 32 = F
Q.17 WAP to read todays date (only date Part) from user. Then display how many days are
left in the current month.
Q.18 WAP to print the area of circle when radius of the circle is given by user.
Q.19 WAP to print the volume of a cylinder when radius and height of the cylinder is given
by user.
Q.20 WAP to find area of a triangle.
Q.21 WAP to calculate simple interest.
Q.22 WAP to read a number in n and prints n2, n3, n4
Q.4 What are mutable and immutable types in Python? List both of them.
Q.5 What are augmented assignment operators? How are they useful?
Q.3 WAP to take two numbers and check that the first number is fully divisible by second
number or not.
Q.6 WAP to take value of x,y,z from the user and calculate the equation 4𝗑4 + 3𝑦3 + 9z2 + 6𝜋
Q.7 WAP to take the temperatures of all 7 days of the week and displays the average
temperature of that week.
Q.2 What are loops in Python? How many types of loop are there in Python?
Q.3 What is the syntax of if-elif statement in Python?
Q.4 What are jump statements in Python? Name jump statements with example.
.
Q.5 Rewrite the following code fragment using for loop.
Q.6 What is the error in following code. Rewrite the correct code.
Correct
Code:
Q.11 WAP to find the average of the list of the numbers entered through keyboard.
Q.12 WAP to find the largest number from the list of the numbers entered throughkeyboard.
Q.13 WAP to find the 2nd largest number from the list of the numbers entered
throughkeyboard. (This program is from List Chapter)
Q.2 WAP that searches for prime numbers from 15 through 25.
Q.4 WAP to compute the result when two numbers and one operator is given by user.
Q.5 WAP to calculate the roots of a given quadratic equation.
STRING MANIPULATION
Very Short answer Type Questions
Q.1 which of the following is not a Python legal string operation?
(a) ‟abc‟+‟abc‟ (b) „abc‟*3 (c)‟abc‟ + 3 (d)‟abc‟.lower()
Q.2 Out of the following operators, which ones can be used with strings?
=, -, *, /, //, %, >, <>, in, not in, <=
Q.3 From the string S = “CARPE DIEM”. Which ranges return “DIE” and “CAR”?
Q.4 Given a string S = “CARPE DIEM”. If n is length/2 then what would following return?
(a) S[:n] (b) S[n:] (c) S[n:n] (d) S[1:n] (e) S[n:length-1]
Q.3 Which functions would you chose to use to remove leading and trailing white spaces
from a given string?
Q.4 Suggest appropriate functions for the following tasks –
(a) To check whether the string contains digits.
(b) To find the occurrence a string within another string.
(c) To convert the first letter of a string to upper case.
(d) To convert all the letters of a string to upper case.
(f) To check whether all the letters of the string are in capital letters.
(g) to remove all the white spaces from the beginning of a string.
LIST MANIPULATION
Very Short answer Type Questions
Q.1 What do you understand by mutability?
Q.2 Start with the list[8,9,10]. Do the following using list functions
(a) Set the second entry (index 1) to 17
(b) Add 4, 5 and 6 to the end of the list.
(c) Remove the first entry from the list.
(d) Sort the list.
(e) Double the list.
(f) Insert 25 at index 3
Q.3 If a is [1, 2, 3], what is the difference (if any) between a*3 and [a, a, a]?
Q.1 How are lists different from strings when both are sequences?
Q.2 What are nested Lists?
Q.3 Discuss the utility and significance of Lists.
Q.4 What is the purpose of the del operator and pop method? Try deleting a slice.
Q.5 What are list slices?
Q.6 What do you understand by true copy of a list? How is it different from shallow copy?
TUPLES
Very Short answer Type Questions
Q.1 What do you understand by immutability?
Q.3 If a is (1, 2, 3), what is the difference (if any) between a*3 and [a, a, a]?
Q.4 If a is (1, 2, 3), is a *3 equivalent to a + a + a?
Q.5 If a is (1, 2, 3), what is the meaning of a [1:1] = 9?
Q.6 If a is (1, 2, 3), what is the meaning of a [1:2] = 4 and a [1:1] = 4?
Q.7 Does a slice operator always produce a new Tuple?
Q.8 How is an empty Tuple created?
Q.9 How is a tuple containing just one element created?
Q.1 How are Tuples different from Lists when both are sequences?
Q.2 Can tuples be nested?
Q.3 Discuss the utility and significance of Tuples.
Q.4 How can you say that a tuple is an ordered list of objects?
Chapter – 9: DICTIONARIES
Very Short answer Type Questions
Q.1 Why can‟t List can be used as keys?
Q.2 What type of objects can be used as keys in dictionary?
Q.3 Can you change the order of the dictionaries contents?
Q.4 Can you modify the keys in a dictionary?
Q.5 Can you modify the value in a dictionary?
Q.6 Is dictionary Mutable? Why?
Short Answer Type Questioemns
Q.1 How are dictionaries different from Lists?
Q.2 When are dictionaries more useful than lists?
Q.2 WAP to create a dictionary named year whose keys are month names and values are
their corresponding number of days.
************************************************************************
Q.8
.