Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
264 views

Python Test - 2: Time: 1Hr Max. Marks 30

1. The document is a Python test with 3 sections - Section A with 6 multiple choice questions worth 2 marks each, Section B with 4 programming questions worth 3 marks each, and Section C with 1 question worth 6 marks about Python control flow statements or predicting output. 2. Section A tests basic Python concepts like data types, strings, loops, variables, and built-in functions. Section B requires writing simple programs to print multiplication tables, sequences, check prime numbers, and count vowels/consonants. 3. Section C dives deeper, either explaining Python statements like break, continue, and pass in detail with an example, or predicting the output of a sample code using these statements. The test
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)
264 views

Python Test - 2: Time: 1Hr Max. Marks 30

1. The document is a Python test with 3 sections - Section A with 6 multiple choice questions worth 2 marks each, Section B with 4 programming questions worth 3 marks each, and Section C with 1 question worth 6 marks about Python control flow statements or predicting output. 2. Section A tests basic Python concepts like data types, strings, loops, variables, and built-in functions. Section B requires writing simple programs to print multiplication tables, sequences, check prime numbers, and count vowels/consonants. 3. Section C dives deeper, either explaining Python statements like break, continue, and pass in detail with an example, or predicting the output of a sample code using these statements. The test
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

PYTHON TEST - 2

Note: God is your invigilator Time: 1Hr Max. Marks = 30

Section – A (2 Marks Each)


1- What is the output of the following code : (MCQ)
print(9//2)
a) 4 b) 4.5 c) 4.0 d) Error

2- Write a program to input a string from the user and determine whether it
is a palindrome or not.

3- Predict the output:-


for i in range( 1, 10, 3):
print(i)

4- Rewrite the following code in python after removing all syntax error(s).
Underlining each correction done in the code.
30=x
For I in range(2,6)
if x>30:
print(“true”) else
Print(“False”)
5- Which of the following can be used as valid variable identifiers (s) in
Python?
i) 4th Sum
ii) Total
iii) Number#
iv) _Data
6- What is the output of the following program : print "Hello World"[::-1]
(a)dlroWolleH (b) Hello Worl (c) d (d) Error
Section – B (3 Marks Each)
1. Write a program to print multiplication table of number entered by the
user?
Sample output:
If number = 2
2X1=2
2X2=4
........
........
2 x 10 = 20

2. Write a program that uses a for loop to print the numbers 8, 11, 14, 17, 20,
. . . , 83, 86, 89.

3. Input a number and check if the number is prime number or not.

4. Write a program to input a string from the user, count and display the
number of vowels and consonants characters in the string.

Section – C (6 Marks Each)


1. Explain the use of break, continue and pass statement in detail. Illustrate
each with an example?
OR
Predict the output:-
for i in range(1,11):
if(i==3):
print("hello", end=' ')
continue
if(i==8):
break
if(i==5):
pass
else:
print(i, end=' ')

You might also like