SlideShare a Scribd company logo
PYTHON
MCQ
Question: What is Python?
Option 1: A high-level programming language
Option 2: A low-level programming language
Option 3: A database management system
Option 4: A data analysis tool
Correct Response: 1
Explanation: Python is a high-level, interpreted, and generalpurpose
dynamic programming language.
2
NAME SOME OF THE FEATURES OF PYTHON.
OPTION 1: OBJECT-ORIENTED
OPTION 2: HIGH-LEVEL
OPTION 3: INTERPRETED
OPTION 4: DYNAMIC
CORRECT RESPONSE: 1, 2, 3
EXPLANATION: PYTHON IS AN OBJECT-ORIENTED, HIGH-
LEVEL, INTERPRETED, AND DYNAMIC PROGRAMMING
LANGUAGE.
What is the purpose of PYTHONPATH environment
variable?
Option 1: To set the location of the Python
interpreter
Option 2: To set the location of the Python libraries
Option 3: To set the location of the Python modules
Option 4: To set the location of the Python scripts
Correct Response: 2
Explanation: The PYTHONPATH environment
variable is used to set the location of the Python
libraries.
What is the purpose of PYTHONSTARTUP
environment
variable?
Option 1: To set the location of the Python
interpreter
Option 2: To set the location of the Python
libraries
Option 3: To set the location of the Python scripts
that will run automatically when the Python
interpreter starts
Option 4: To set the location of the Python
modules
Correct Response: 3
5
What is the purpose of PYTHONCASEOK environment
variable?
Option 1: To ignore the case sensitivity of the Python
keywords
Option 2: To ignore the case sensitivity of the Python variables
Option 3: To ignore the case sensitivity of the Python
functions
Option 4: To ignore the case sensitivity of the Python modules
Correct Response: 1
Explanation: The PYTHONCASEOK environment variable is
used to ignore the case sensitivity of the Python keywords.
6
What are the supported data types in
Python?
Option 1: Integer
Option 2: Float
Option 3: String
Option 4: All of the above
Correct Response: 4
What is the output of print str if str = 'Hello
World!'?
Option 1: Error
Option 2: None
Option 3: 'Hello World!'
Option 4: 'Hello world!'
Correct Response: 3
Explanation: The output of the print
statement will be 'Hello World!', as the value
of the variable 'str' is assigned the string 'Hello
World!'.
7
What is the
output of
print str[0] if
str = 'Hello
World!'?
•Option 1: Error
•Option 2: None
•Option 3: 'H'
•Option 4: 'h'
•Correct Response:
3
What is the output of print str[2:5] if
str = 'Hello World!'?
Option 1: 'llo'
Option 2: 'llo World'
Option 3: 'Hello World'
Option 4: 'llo Wo'
Correct Response: 1
8
What is the output of print str[2:] if str = 'Hello
World!'?
•Option 1: 'llo'
•Option 2: 'Hello World'
•Option 3: 'llo World!'
•Option 4: 'llo Wo'
•Correct Response: 3
• Explanation: The slice of the string starts at index
2 and goes up to the end of the string, so the
result is 'llo World!'
9
What is the output of print str * 2 if str
= 'Hello World!'?
Option 1: 'Hello World!Hello World!'
Option 2: 'HelloWorld!HelloWorld!'
Option 3: 'Hello World'
Option 4: 'Hello Wo'
Correct Response: 1
Explanation: The string is repeated twice,
so the result is 'Hello World!Hello World!'
What is the output
of print str + "TEST"
if str = 'Hello
World!'?
1.Option 1: 'Hello
World!TEST'
2.Option 2: 'Hello
WorldTEST'
3.Option 3: 'Hello World!'
4.Option 4: 'Hello Wo'
5.Correct Response: 1
10
THANK YOU

More Related Content

PDF
Python interview questions
PDF
problem solving and python programming UNIT 2.pdf
PDF
Problem Solving and Python Programming UNIT 2.pdf
PPTX
Python Tutorial for Beginner
PPTX
PYTHON PROGRAMMING.pptx
PDF
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
PPTX
Python
PDF
Tutorial on-python-programming
Python interview questions
problem solving and python programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdf
Python Tutorial for Beginner
PYTHON PROGRAMMING.pptx
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
Python
Tutorial on-python-programming

Similar to Python mcq questions excel your python knowledge (20)

DOC
Core Python.doc
PDF
Top 80 Interview Questions on Python for Data Science | Tutort - Best Data Sc...
PDF
GE3151_PSPP_UNIT_2_Notes
PPTX
python introduction initial lecture unit1.pptx
PPTX
Introduction to Python Programming Language
PPTX
1-_Introduction_To_Python.pptx for developers
PDF
Python (3).pdf
PPTX
introduction to python programming concepts
PPTX
Introduction to Python for Data Science and Machine Learning
PDF
Python final ppt
PDF
Pythonfinalppt 170822121204
PPT
Python - Module 1.ppt
PDF
web programming UNIT VIII python by Bhavsingh Maloth
PDF
Introduction to python programming
PPTX
Python Programming-1.pptx of python by computer
PPTX
1-Introduction to Python, features of python, history of python(1).pptx
PDF
Stu_Unit1_CSE1.pdf
PPT
UNIT 1 PY .ppt - PYTHON PROGRAMMING BASICS
Core Python.doc
Top 80 Interview Questions on Python for Data Science | Tutort - Best Data Sc...
GE3151_PSPP_UNIT_2_Notes
python introduction initial lecture unit1.pptx
Introduction to Python Programming Language
1-_Introduction_To_Python.pptx for developers
Python (3).pdf
introduction to python programming concepts
Introduction to Python for Data Science and Machine Learning
Python final ppt
Pythonfinalppt 170822121204
Python - Module 1.ppt
web programming UNIT VIII python by Bhavsingh Maloth
Introduction to python programming
Python Programming-1.pptx of python by computer
1-Introduction to Python, features of python, history of python(1).pptx
Stu_Unit1_CSE1.pdf
UNIT 1 PY .ppt - PYTHON PROGRAMMING BASICS
Ad

Recently uploaded (20)

PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Empowerment Technology for Senior High School Guide
PDF
Trump Administration's workforce development strategy
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Hazard Identification & Risk Assessment .pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Cell Types and Its function , kingdom of life
PPTX
Lesson notes of climatology university.
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Classroom Observation Tools for Teachers
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
A powerpoint presentation on the Revised K-10 Science Shaping Paper
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Empowerment Technology for Senior High School Guide
Trump Administration's workforce development strategy
Unit 4 Skeletal System.ppt.pptxopresentatiom
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Final Presentation General Medicine 03-08-2024.pptx
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Paper A Mock Exam 9_ Attempt review.pdf.
Hazard Identification & Risk Assessment .pdf
RMMM.pdf make it easy to upload and study
What if we spent less time fighting change, and more time building what’s rig...
Cell Types and Its function , kingdom of life
Lesson notes of climatology university.
Orientation - ARALprogram of Deped to the Parents.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Classroom Observation Tools for Teachers
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Ad

Python mcq questions excel your python knowledge

  • 2. Question: What is Python? Option 1: A high-level programming language Option 2: A low-level programming language Option 3: A database management system Option 4: A data analysis tool Correct Response: 1 Explanation: Python is a high-level, interpreted, and generalpurpose dynamic programming language. 2
  • 3. NAME SOME OF THE FEATURES OF PYTHON. OPTION 1: OBJECT-ORIENTED OPTION 2: HIGH-LEVEL OPTION 3: INTERPRETED OPTION 4: DYNAMIC CORRECT RESPONSE: 1, 2, 3 EXPLANATION: PYTHON IS AN OBJECT-ORIENTED, HIGH- LEVEL, INTERPRETED, AND DYNAMIC PROGRAMMING LANGUAGE.
  • 4. What is the purpose of PYTHONPATH environment variable? Option 1: To set the location of the Python interpreter Option 2: To set the location of the Python libraries Option 3: To set the location of the Python modules Option 4: To set the location of the Python scripts Correct Response: 2 Explanation: The PYTHONPATH environment variable is used to set the location of the Python libraries.
  • 5. What is the purpose of PYTHONSTARTUP environment variable? Option 1: To set the location of the Python interpreter Option 2: To set the location of the Python libraries Option 3: To set the location of the Python scripts that will run automatically when the Python interpreter starts Option 4: To set the location of the Python modules Correct Response: 3 5
  • 6. What is the purpose of PYTHONCASEOK environment variable? Option 1: To ignore the case sensitivity of the Python keywords Option 2: To ignore the case sensitivity of the Python variables Option 3: To ignore the case sensitivity of the Python functions Option 4: To ignore the case sensitivity of the Python modules Correct Response: 1 Explanation: The PYTHONCASEOK environment variable is used to ignore the case sensitivity of the Python keywords. 6
  • 7. What are the supported data types in Python? Option 1: Integer Option 2: Float Option 3: String Option 4: All of the above Correct Response: 4 What is the output of print str if str = 'Hello World!'? Option 1: Error Option 2: None Option 3: 'Hello World!' Option 4: 'Hello world!' Correct Response: 3 Explanation: The output of the print statement will be 'Hello World!', as the value of the variable 'str' is assigned the string 'Hello World!'. 7
  • 8. What is the output of print str[0] if str = 'Hello World!'? •Option 1: Error •Option 2: None •Option 3: 'H' •Option 4: 'h' •Correct Response: 3 What is the output of print str[2:5] if str = 'Hello World!'? Option 1: 'llo' Option 2: 'llo World' Option 3: 'Hello World' Option 4: 'llo Wo' Correct Response: 1 8
  • 9. What is the output of print str[2:] if str = 'Hello World!'? •Option 1: 'llo' •Option 2: 'Hello World' •Option 3: 'llo World!' •Option 4: 'llo Wo' •Correct Response: 3 • Explanation: The slice of the string starts at index 2 and goes up to the end of the string, so the result is 'llo World!' 9
  • 10. What is the output of print str * 2 if str = 'Hello World!'? Option 1: 'Hello World!Hello World!' Option 2: 'HelloWorld!HelloWorld!' Option 3: 'Hello World' Option 4: 'Hello Wo' Correct Response: 1 Explanation: The string is repeated twice, so the result is 'Hello World!Hello World!' What is the output of print str + "TEST" if str = 'Hello World!'? 1.Option 1: 'Hello World!TEST' 2.Option 2: 'Hello WorldTEST' 3.Option 3: 'Hello World!' 4.Option 4: 'Hello Wo' 5.Correct Response: 1 10

Editor's Notes

  • #5: What is the purpose of PYTHONPATH environment variable? Option 1: To set the location of the Python interpreter Option 2: To set the location of the Python libraries Option 3: To set the location of the Python modules Option 4: To set the location of the Python scripts Correct Response: 2 Explanation: The PYTHONPATH environment variable is used to set the location of the Python libraries.