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

INTRODUCTION TO PYTHON

00:00:00

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

print('abcd'.translate('a'.maketrans('abc', 'bcd')))

Option A. bcde
Option B. abcd
Option C. error
Option D. bcdd
True Answer D

Explanation :
The output is bcdd since no translation is provided for d.

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

print('abcd'.translate('a'.maketrans('abc', 'bcd')))

Question No# : 01 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# : 02 out of 20

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

print(''''''.isspace())

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

Explanation :
None.

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

print(''''''.isspace())

Question No# : 03 out of 20



The ______ mode of Python gives instant result of typed statement

Option A. Interactive Mode
Option B. Script Mode
Option C. Combination of Interactive and Script modes
Option D. All of these
True Answer A

Explanation :

The ______ mode of Python gives instant result of typed statement

Question No# : 04 out of 20

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

print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))

Option A. abcd
Option B. 1234
Option C. error
Option D. none of the mentioned
True Answer A

Explanation :
The function translate expects a dictionary of integers. Use maketrans() instead of doing the above.

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

print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))

Question No# : 05 out of 20



Python Programs are typed in

Option A. Interactive Mode
Option B. Script Mode
Option C. A Combination of interactive and script Mode
Option D. All of These
True Answer B

Explanation :

Python Programs are typed in

Question No# : 06 out of 20

You can create program in Python , interactive Mode

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

Explanation :

You can create program in Python , interactive Mode

Question No# : 07 out of 20

Which of the following is not a Python IDE

Option A. IDLE
Option B. Spyder
Option C. Jupyter Notes
Option D. Sublime Test
True Answer D

Explanation :

Which of the following is not a Python IDE

Question No# : 08 out of 20

Python code can run on a variety of platforms, it means Python is a _____ language.

Option A. Graphical
Option B. Cross-platform
Option C. Independent
Option D. All of these
True Answer B

Explanation :

Python code can run on a variety of platforms, it means Python is a _____ language.

Question No# : 09 out of 20

To convert the read value through input() into integer type, ______ () is used

Option A. floating
Option B. float
Option C. int
Option D. integer
True Answer C

Explanation :

To convert the read value through input() into integer type, ______ () is used

Question No# : 10 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# : 11 out of 20



To print a line a text without ending it with a newline, ____ argument is used with print()

Option A. sep
Option B. newline
Option C. end
Option D. next
True Answer C

Explanation :

To print a line a text without ending it with a newline, ____ argument is used with print()

Question No# : 12 out of 20

Which of the following is not a legal integer type value in Python

Option A. Decimal
Option B. Octal
Option C. Hexadecimal
Option D. Roman
True Answer D

Explanation :

Which of the following is not a legal integer type value in Python

Question No# : 13 out of 20

Which of these in not a core data type?

Option A. Lists
Option B. Dictionary
Option C. Tuples
Option D. Class
True Answer D

Explanation :
Class is a user defined data type.

Which of these in not a core data type?

Question No# : 14 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# : 15 out of 20



Which of the following cannot be a variable?

Option A. __init__
Option B. in
Option C. it
Option D. on
True Answer B

Explanation :
in is a keyword which is used to check if a value is present in a list, tuple, etc.

Which of the following cannot be a variable?

Question No# : 16 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# : 17 out of 20

Variable are created when they are first assigned their value.

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

Explanation :

Variable are created when they are first assigned their value.

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

Python variables support dynamic typing

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

Explanation :

Python variables support dynamic typing

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