KEMBAR78
Question Bank Class Xi Computer Science | PDF | Computer Science | Software Engineering
0% found this document useful (0 votes)
616 views8 pages

Question Bank Class Xi Computer Science

This document contains questions from various chapters of the Computer Science textbook for Class XI. It includes questions on Python fundamentals like keywords, identifiers, operators and string operations. It also has questions on conditional statements, loops, lists, tuples, dictionaries, sorting, debugging, state transition diagrams, cyber safety, online security and other topics. The questions range from short answers to writing small programs.
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)
616 views8 pages

Question Bank Class Xi Computer Science

This document contains questions from various chapters of the Computer Science textbook for Class XI. It includes questions on Python fundamentals like keywords, identifiers, operators and string operations. It also has questions on conditional statements, loops, lists, tuples, dictionaries, sorting, debugging, state transition diagrams, cyber safety, online security and other topics. The questions range from short answers to writing small programs.
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
You are on page 1/ 8

Question Bank

Class XI
Computer Science
Chapter-Introduction to python

Q1. Write Short note using example:

1) Keywords 2) Identifier 3) len() 4) split() 5) title() 6) lower()

Q2. Differentiate between using example:

1) if / else 2) for / while 3) break /continue

Q3. Find output: if The List is : String = “Iron Port Email Gateway Appliances.”

1) print (String[ 0: 7 ] )

2) print (String[ 5:27 ] )

3) print (String[ 9:21 ] )

4) print (String[23:29 ] )

5) print (String[ 1:10 ] )

6) print (String[12:14 ] )

7) print (String[ 4:10:3 ])

8) print (String[ 2: :4 ])

Q4. Find output: If a, b, c, d, e = 8, 6, 7, 2, 10 find value of R=?

1) R=a+b-d//c*d
2) R=e/c+d-a%d
3) R=a-c/b+d
4) R=a*b//e+c/d

5) R=b//c/d%e+c
6) R=c-d/b//a%d
7) R=a%e-c//b
8) R=c-a+b%d*a

Q6. Draw Logical Diagram using AND, OR, NOT:

1) (AB+C’)D’

2) (P+Q)(Q’+P)’

3) (P’+Q)’+(Q’+P)’

Q7. Write Program:

1. Write a program using python to print the division of a student after accepting :

Per division
< 40 failed
40 to 50 third
50 to 60 second
>=60 first
2. Write a program to display all even factors of a given number till N.
3. Write a program to replace every space with a hyphen (#) in string.

CHAPTER 2

PYTHON FUNDAMENTALS

1 Out of the followings, Find those identifiers, which cannot be used for naming

Variables, Functions in a Python programming language:

Roll#No, continue, True, 41stno, _v1, No_2, false, Var1

2 Write the following operators according to the precedence rule :


or, and, not, <>, *, **, ()

3 Which of the following is not a legal string operation and Why:


>>>"KV"+"KDML" % 2 , >>>'Kendriya'+'Vidyalaya'
>>>"K"+"V"+"KDML", >>>'KV' * 5

4 Write the following mathematics expression in python code:

(i) |a − b| +(a+b)
3 (b−c)
(ii) √cos x+(a + b)3 − a2
5 Write a python program which will accept an integer N and check whether it is a 3 digit
number or not.

CHAPTER 3
DATA HANDLING

1 What will the result given by the following?


i.type(6+3) ii. type(6/3)

2 What will be the output produced by following code?


a = 5-4-3
b=3**2**3
print(a)
print(b)

3 What is the difference between mutable and immutable? Explain with example.
4 What will be the output produced by following code?

x=20
x=x+5
x=x-10
print(x)
x,y=x-1,50
print (x,y)

5 Write a program in python to take marks of 5 different subjects as inputs then


calculate the average .if the average is >33 print pass else print fail
CHAPTER 4

CONDITIONAL AND ITERATIVE STATEMENTS

Q1Correct the errors in the following code. Underline each correction.

w = “Raining”
if w = “sunny” :
print(“Wear Sun Block’)
elif : w= “snow”
print(“Going Skiing”)
else:
print("Weather")

Q2 What will be the output of the following python code:If the string entered in name variable
as: “PYTHON”
LS = [1, 9, 6,7, 80, 90]
ln=len(LS)
for k in range(0,ln):
print(LS[k], end=" , ")
print("\n Conversion Print: ")
for k in range(-1,-(ln+1),-1):
print(LS[k], end=" , ")

Q3Write the output of the following code:

v=5
if(v+5==11):
print((v+5==11)+1)
else:
print((v+5==11)+2)

print(v+5<=10)

CHAPTER 5
STRING MANIPULATION

1 Find the output


x = “hello world”
print(x[:2], x[-2:])
print(x[2:-3], x[-4:-2])

2 Find the output


forthefollowing::
str=”Kendriyavidyalaya
GreaterNoida”
print(“Line1”,str*19+,
end=’#’) print(“\t”,str*4:7+)
print(str*3, str*27:+), sep=”***”)

3 Given a String s=”Vivekanand Public School”. If n=int(len(s)/2), then what will be

the output of the following statements:


>>>print(s[0:n]), >>>print(s[0:3]), >>>s[:n], >>>s[n:]

4 Find the output of the following:

i)a = True
b = False
c = False
if a or b and c:
print “ KVS IS BEST”
else:
print “kvs is best”
ii)string = ‘It goes as – ringaringa roses’
sub = ‘ringa’
print ( string.find( sub, 15, 25 ))

5 Write a python script that traverses through an input string and prints its

characters in different lines – two characters per line.

CHAPTER 6
DEBUGGING PROGRAMS
1 What are main error types? Which types are most dangerous and why?
2 What is a difference between an error and exception?
3 Name some common built-in exceptions in Python.
4 when does these exception occur?
(a) Type Error (b) Index Error (c) Name Error
5 What is debugging and code tracing?

CHAPTER 7
LIST MANIPULATION

1 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

2 If a is [1, 2, 3], what is the difference (if any) between a*3 and [a, a, a]?
3 If a is [1, 2, 3], is a *3 equivalent to a + a + a?
4 Does a slice operator always produce a new list?
5 What are nested Lists?

CHAPTER 8
TUPLES

1 WAP that creates a tuple storing first 9 items of Fibonacci Series.

2 WAP that creates a third tuple after adding two tuples. Add second after first tuple.
3 WAP to calculate the mean of the numbers of the tuple.
4 WAP to calculate the average of the numbers of the tuple.
5 Find out the output generated by following code fragments:

(a) plane = (“Passengers”, ”Luggage”)


plane *1+ = “Snakes”
(b) (a, b, c) = (1,2,3) (c) (a, b, c, d) = (1,2,3)
(d) a, b, c, d = (1,2,3) (e) a, b, c, d, e = (p, q, r, s, t) = t1

CHAPTER 9
DICTIONARIES

1 Create a dictionary whose keys are month manes and whose values are the number of days

in the corresponding months.


(a) Ask the user to enter a month name and use the dictionary to tell how many days are in the
month.
(b) Print out all of the keys in alphabetical order.
(c) Print out all of the months with 31 days.
(d) Print out the (key-value) pairs sorted by the number of days in each month.
2 Can you store the details of 10 students in a dictionary at the same time? Details include –

rollno, name, marks, grade etc, give example to spot our answer.

3 Given the dictionary x = ,‘k1’:’v1’,’k2’:’v2’,’k3’:’v3’-, create a dictionary with the opposite

mapping , i.e., write a program to create the dictionary as :


Inverted_x = ,‘v1’:’k1’,’v2’:’k2’,’v3:’k3’-

4 Given two dictionaries say d1 and d2. Write a program, that lists the overlapping keys of the

two dictionaries , i.e. if a key of d1 is also a key of d2, the list it.

5 Write a program that checks if two same values in a dictionary have different keys. That is,
for dictionary d1 = ,‘a’:10,’b’:20,’c’:10-, the program should print “2 keys have same values”
and for dictionary d2 = ,‘a’:10,’b’:20,’c’:10-, the program should print “No keys have same
values”.

CHAPTER 10
UNDERSTANDING SORTING

1 What is the basic principal of sorting in Insertion sort?

2 number of operations wise, compare bubble sort and insertion sort techniques.
3 Why insertion sort is considered a better algorithm than bubble sort?
4 In which situations, insertion sort also becomes inefficient?
5 When and why would you choose insertion sort over bubble sort?

CHAPTER – 11
STATE AND TRANSITIONS

1 What are state transition diagrams?


2 What is the utility of state transition diagram?
3 What does a state signify?
4 How is a transition linked to states?
5 Draw a state transition diagram for operation of an ATM machine.

CHAPTER – 21
CYBER SAFETY

1 What is cyber crime ?how can you report it?


2 What is cyber bullying and cyber stalking?
3 What is identity fraud?
4 What is digital footprint? Why is it so important?
5 Why are privacy settings of a social networking site so important?

CHAPTER – 22
ONLINE ACCESS AND COMPUTER SECURITY

1 What is phishing?
2 How is pharming similar to and different from phishing?
3 What is (i) authentication (ii) authorization ?why are these two used together?
4 What is the significance of a firewall in a computer’s security scheme?
5 What is eavesdropping ?what security measures can you take up to prevent it?

You might also like