QUIZ ON : PROGRAMMING AND PROBLEM SOLVING THROUGH PYTHON - INTRODUCTION TO PYTHON

INTRODUCTION TO PYTHON

00:00:00

0128 is a legal literal value in Python

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

0128 is a legal literal value in Python

Question No# : 01 out of 20

What will be the output of the following Python code snippet?

print('1@ a'.isprintable())

Option A. True
Option B. False
Option C. None
Option D. Error
True Answer A

Explanation :
All those characters are printable.

What will be the output of the following Python code snippet?

print('1@ a'.isprintable())

Question No# : 02 out of 20



What will be the output of the following Python code?

print('ab'.isalpha())

Option A. True
Option B. False
Option C. None
Option D. Error
True Answer A

Explanation :
The string has only letters.

What will be the output of the following Python code?

print('ab'.isalpha())

Question No# : 03 out of 20



What will be the output of the following Python code?

print('abcd'.partition('cd'))

Option A. (‘ab’, ‘cd’, ”)
Option B. (‘ab’, ‘cd’)
Option C. error
Option D. none of the mentioned
True Answer A

Explanation :
The last item is a null string.

What will be the output of the following Python code?

print('abcd'.partition('cd'))

Question No# : 04 out of 20



Which of the following is not a token ?

Option A. Interpreter
Option B. Identifiers
Option C. Keyword
Option D. Operators
True Answer A

Explanation :

Which of the following is not a token ?

Question No# : 05 out of 20

Python is a/an _________ language.

Option A. High Level
Option B. Low Level
Option C. Procedural
Option D. Difficult
True Answer A

Explanation :

Python is a/an _________ language.

Question No# : 06 out of 20

Is Python case sensitive when dealing with identifiers?

Option A. yes
Option B. no
Option C. machine dependent
Option D. none of the mentioned
True Answer A

Explanation :
The arguments are accessed by their names. Case is always significant.

Is Python case sensitive when dealing with identifiers?

Question No# : 07 out of 20



What will be the output of the following Python code snippet?

print('1.1'.isnumeric())

Option A. True
Option B. False
Option C. None
Option D. Error
True Answer B

Explanation :
The character . is not a numeric character.

What will be the output of the following Python code snippet?

print('1.1'.isnumeric())

Question No# : 08 out of 20



What will be the output of the following Python code?

print('xyyzxxyxyy'.lstrip('xyy'))

Option A. error
Option B. zxxyxyy
Option C. z
Option D. zxxy
True Answer B

Explanation :
The leading characters containing xyy are removed.

What will be the output of the following Python code?

print('xyyzxxyxyy'.lstrip('xyy'))

Question No# : 09 out of 20



To give a different separator with print() ______ argument is sued.

Option A. sep
Option B. separator
Option C. end
Option D. tab
True Answer A

Explanation :

To give a different separator with print() ______ argument is sued.

Question No# : 10 out of 20

Select the reserve keyword in Python

Option A. else
Option B. import
Option C. print
Option D. all of these
True Answer D

Explanation :

Select the reserve keyword in Python

Question No# : 11 out of 20

What will be the output of the following Python code?

print('a'.maketrans('ABC', '123'))

Option A. {97: 49, 98: 50, 99: 51}
Option B. {65: 49, 66: 50, 67: 51}
Option C. {97: 49}
Option D. 1
True Answer B

Explanation :
maketrans() is a static method so it’s behaviour does not depend on the object from which it is being called.

What will be the output of the following Python code?

print('a'.maketrans('ABC', '123'))

Question No# : 12 out of 20



What will be the output of the following Python code?

print('abcdefcdgh'.partition('cd'))

Option A. (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
Option B. (‘ab’, ‘cd’, ‘efcdgh’)
Option C. (‘abcdef’, ‘cd’, ‘gh’)
Option D. error
True Answer B

Explanation :
The string is partitioned at the point where the separator first appears.

What will be the output of the following Python code?

print('abcdefcdgh'.partition('cd'))

Question No# : 13 out of 20



Which of the following is an invalid statement?

Option A. abc = 1,000,000
Option B. a b c = 1000 2000 3000
Option C. a,b,c = 1000, 2000, 3000
Option D. a_b_c = 1,000,000
True Answer B

Explanation :
Spaces are not allowed in variable names.

Which of the following is an invalid statement?

Question No# : 14 out of 20



names Given to different parts of a Python program are_____

Option A. Identifiers
Option B. Function
Option C. Keywords
Option D. Literals
True Answer A

Explanation :

names Given to different parts of a Python program are_____

Question No# : 15 out of 20

What will be the output of the following Python code?

print('''  \tfoo'''.lstrip())

Option A. foo
Option B. foo
Option C. foo
Option D. none of the mentioned
True Answer B

Explanation :
All leading whitespace is removed.

What will be the output of the following Python code?

print('''  \tfoo'''.lstrip())

Question No# : 16 out of 20



The expression shown below results in an error.

print("-%5d0",989)

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :
The expression shown above does not result in an error. The output of this expression is -%5d0 989. Hence this statement is incorrect.

The expression shown below results in an error.

print("-%5d0",989)

Question No# : 17 out of 20



Which of the following character is used to give comments in Python Program ?

Option A. #
Option B. &
Option C. @
Option D. $
True Answer A

Explanation :

Which of the following character is used to give comments in Python Program ?

Question No# : 18 out of 20

The data type whose representation is unknown are called

Option A. Built in datatype
Option B. Derived datatype
Option C. Concrete datatype
Option D. Abstract datatype
True Answer D

Explanation :
A concrete data type is a data type whose representation is known and in abstract data type the representation of a data type is unknown

The data type whose representation is unknown are called

Question No# : 19 out of 20

What will be the output of the following Python code snippet?

print('abef'.replace('cd', '12'))

Option A. abef
Option B. 12
Option C. error
Option D. none of the mentioned
True Answer A

Explanation :
The first substring is not present in the given string and hence nothing is replaced.

What will be the output of the following Python code snippet?

print('abef'.replace('cd', '12'))

Question No# : 20 out of 20




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad