0% found this document useful (0 votes)
122 views2 pages

Class 12 CS Homework

This document contains a home assignment for a Computer Science class involving Python programming questions. The questions cover topics like data types, operators, conditional statements, loops, functions, and more. Students are asked to write short answers, code snippets, and longer explanations. For example, one question asks students to write code that checks if a number is divisible by 7, while another asks them to explain type conversion in Python with examples. Overall, the assignment aims to test students' understanding of key Python concepts through a variety of question types.

Uploaded by

Aditya Aurange
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)
122 views2 pages

Class 12 CS Homework

This document contains a home assignment for a Computer Science class involving Python programming questions. The questions cover topics like data types, operators, conditional statements, loops, functions, and more. Students are asked to write short answers, code snippets, and longer explanations. For example, one question asks students to write code that checks if a number is divisible by 7, while another asks them to explain type conversion in Python with examples. Overall, the assignment aims to test students' understanding of key Python concepts through a variety of question types.

Uploaded by

Aditya Aurange
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/ 2

KENDRIYA VIDYLAYA TAMULPUR

SUMMER VACATIONS HOME WORK


CLASS XII
COMPUTER SCIENCE NEW (083)

SECTION A

VERY SHORT ANSWER QUESTIONS

1. “Welcome‟ is ___________literals
2. $ symbol can be used in naming an identifier (True/False)
3. Write any 2 data types available in Python.
4. range(1,10) will return values in the range of to
5. randint(1,10) will return values in the range of to

Raj was working on application where he wanted to divide the


two number (A and B) , he has written the expression as C =
A/B, on execution he entered 30 and 7 and expected answer was 4
i.e. only integer part not in decimal, but the answer was 4.285
approx, help Raj to correct his expression and achieving the
desired output.
6. Correct Expression :

Can you guess the output?


C = -11%4
7. print(C)
8. Write 2 advantages and disadvantages of Python programming language.

Identify the valid and Invalid identifiers names:


9. Emp-Code, _bonus, While, SrNo. , for, #count, Emp1, 123Go, Bond007.
10.
Fill in the blanks to execute loop from 10 to 100 and 10 to 1
(i)
for i in range( ):
print(i)

(ii)
for i in range( ):
print(i)
11. Which is the valid dictionary declaration?
I) d1={1:'January',2='February',3:'March'}
II) d2=(1:'January',2:'February',3:'March'}
III) d3={1:'January',2:'February',3:'March'}
IV) d4={1:January,2:February,3:March}
12. What is the value of x? >>>x = int (8/3+5)
13. What is the output of the following code?
>>>print(“Good”, “Morning”)

1|Page
14. What will be the output of following code?
>>> s= [6,5,4,7,8,5]
>>>a.remove(5)
>>>a
15. What will be the output of following program?

>>>my_list = ['p', 'r', 'o', 'b', 'l', 'e', 'm']


>>>print('p' not in my_list)
16. Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is incorrect?
a) print(T[1])
b) T[2] = -29
c) print(max(T))
d) print(len(T))
17. Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 and values are Monday,
Tuesday and Wednesday respectively.
18. Out of the following find those identifiers, which can not be used for naming Variable or Functions in
a Python Program:
Days * Rent, For, A_price, Grand Total, do, 2Clients, Participantl, My city
19. Which string method is used to implement the following?

I. To count the number of characters in the string.


II. To change the first character of the string in capital letter.
III. To check whether given character is letter or a number.
IV. To change lowercase to uppercase letter.
V. Change one character into another character
20. What are the logical operators of Python?
SECTION B

LONG ANSWER QUESTIONS

1. What is type conversion in Python? What are different types ofconversion? Illustrate with
example.
2. Write a program to enter any number and check it is divisible by 7 or not.
3. Explain about the tokens in python programming languages
4. What is an identifier ?what are the rules for declaring the identifiers
5. What are the key words in python programming languages?
6. What are the operators in python programming language?
7. What are the features of python programming language?
8. Write a python program to check the person is eligible or not?
9. Write a Python Program to Calculate the Area of a Triangle.
10. Python Program to Find the Factorial of a Number.
11. Explain about the conditional statements in python with flow charts?
12. Write a Python Program to find the largest of three numbers.
13. Write a python program to reverse the given number using while loop.
14. Write a python program to Check Prime Number or not.
15. Write a Python Program to check if a Number is Odd or Even.

2|Page

You might also like