SlideShare a Scribd company logo
1 of 5
Download to read offline
NPTEL PYTHON FOR DATA SCIENCE
ASSIGNMENT SOLUTIONS (WEEK 1)
1. The command used to clear console in Spyder is:-
Answer B - %clear – An easier way to clear the console in Python
2. Which of the following is a valid variable name?
Answer C - ‘ram_2’
Alphanumeric is a valid variable name convention in Python. And supports a
special character _ (underscore)
Variable names should not begin or end with underscore even though both are
allowed
3. Python files are saved with extension
Answer A - .py
4. Which of the following statement is invalid?
Answer B - m.n.q = 3500, 3600, 3700
Dot operators are used to access functions in Python, hence it is not used in
naming a variable
5. The command to display an output in Python is:-
Answer A and D – display() and print()
6. Assignment operator used in Python is: -
Answer D – “=” (equal to)
7. Consider the variables a and b. Values of a and b are 280 and 15
respectively. The operation that will return a remainder is: -
Answer B - a%b
8. Python command used to calculate 25
is given by:-
Answer C - 2**5
9. The values of variables p and q are 15 and 3 respectively. What is the value
of ‘p’ after running the code below?
p*=q
Answer D – 45
10. Which command would you use to find the data type of a variable
Answer B – type ()
11. Value of variable p is 45. Command to coerce p from integer datatype to
float datatype is:-
Answer B - p=float(p)
12. Indicate which command would you use to set the working directory.
Answer B - os.chdir(“C:/Documents /Data”)
13. Comments in Python begin with
Answer C - #
14. What type of object is x?
x=(“Python”, “version”, “3.7”)
Answer B - Tuple
15. Which of the following method can be used to initialize multiple variables
with a common value?
Answer B - Above 2 and 3
16. What will be the output after the following statements are executed?
X=300
Y= 17
X%=Y
print(X)
Answer A - 11
17. What is the command to clear a single variable ‘a’ from the variable
explorer?
Answer C – del a
18. Which of the package is used for visualization in Python
Answer D – ggplot, matplotlib, and seaborn are visualization packages for
Python
19. “not in” belongs to which type of operator in Python?
Answer A – membership
Python’s membership operators (“in”, “not in”) test for membership in a
sequence, such as strings, lists, or tuples
20. “is not” belongs to which type of operator in Python?
Answer B – identity
“is” and “is not” are the two identity operators - compares the memory locations
of two objects. “is not” evaluates to false if the variables on either side of the
operator point to the same object and true otherwise.

More Related Content

What's hot

EMRS 2018 Replacing rare earth ions in LEDs (?)
EMRS 2018 Replacing rare earth ions in LEDs (?)EMRS 2018 Replacing rare earth ions in LEDs (?)
EMRS 2018 Replacing rare earth ions in LEDs (?)Philippe Smet
 
Atomic absorption spectrcopy
Atomic absorption spectrcopyAtomic absorption spectrcopy
Atomic absorption spectrcopySidhu Taran
 
Critical Chain Management - ادارة السلسلة الحرجة
Critical Chain Management - ادارة السلسلة الحرجةCritical Chain Management - ادارة السلسلة الحرجة
Critical Chain Management - ادارة السلسلة الحرجةEng.Ahmed Said Mohamed Refaei
 
Afm steps to be followed while surface analysis
Afm steps to be followed while surface analysis Afm steps to be followed while surface analysis
Afm steps to be followed while surface analysis seyoum kebede
 
Mass Spectrometry Applications and spectral interpretation: Basics
Mass Spectrometry Applications and spectral interpretation: BasicsMass Spectrometry Applications and spectral interpretation: Basics
Mass Spectrometry Applications and spectral interpretation: BasicsShreekant Deshpande
 
Atomic absorption spectroscopy (AAS)
Atomic absorption spectroscopy (AAS)Atomic absorption spectroscopy (AAS)
Atomic absorption spectroscopy (AAS)SarmisthaPanwar
 
Quantum formula sheet
Quantum formula sheetQuantum formula sheet
Quantum formula sheetLovish pujani
 
CVB222 UV-vis Absorption and Fluorescence Lecture
CVB222 UV-vis Absorption and Fluorescence LectureCVB222 UV-vis Absorption and Fluorescence Lecture
CVB222 UV-vis Absorption and Fluorescence LectureMark Selby
 
Power Law Distributions for Twitter Data
Power Law Distributions for Twitter DataPower Law Distributions for Twitter Data
Power Law Distributions for Twitter DataConor Feeney
 

What's hot (17)

EMRS 2018 Replacing rare earth ions in LEDs (?)
EMRS 2018 Replacing rare earth ions in LEDs (?)EMRS 2018 Replacing rare earth ions in LEDs (?)
EMRS 2018 Replacing rare earth ions in LEDs (?)
 
Atomic absorption spectrcopy
Atomic absorption spectrcopyAtomic absorption spectrcopy
Atomic absorption spectrcopy
 
De Broglie hypothesis
De Broglie hypothesisDe Broglie hypothesis
De Broglie hypothesis
 
Critical Chain Management - ادارة السلسلة الحرجة
Critical Chain Management - ادارة السلسلة الحرجةCritical Chain Management - ادارة السلسلة الحرجة
Critical Chain Management - ادارة السلسلة الحرجة
 
Afm steps to be followed while surface analysis
Afm steps to be followed while surface analysis Afm steps to be followed while surface analysis
Afm steps to be followed while surface analysis
 
Magnetic domain and domain walls
 Magnetic domain and domain walls Magnetic domain and domain walls
Magnetic domain and domain walls
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
 
Mass Spectrometry Applications and spectral interpretation: Basics
Mass Spectrometry Applications and spectral interpretation: BasicsMass Spectrometry Applications and spectral interpretation: Basics
Mass Spectrometry Applications and spectral interpretation: Basics
 
Atomic absorption spectroscopy (AAS)
Atomic absorption spectroscopy (AAS)Atomic absorption spectroscopy (AAS)
Atomic absorption spectroscopy (AAS)
 
Atomic spectroscopy
Atomic spectroscopyAtomic spectroscopy
Atomic spectroscopy
 
Quantum formula sheet
Quantum formula sheetQuantum formula sheet
Quantum formula sheet
 
CVB222 UV-vis Absorption and Fluorescence Lecture
CVB222 UV-vis Absorption and Fluorescence LectureCVB222 UV-vis Absorption and Fluorescence Lecture
CVB222 UV-vis Absorption and Fluorescence Lecture
 
Raman spectroscopy
 Raman spectroscopy Raman spectroscopy
Raman spectroscopy
 
Quantum Chemistry
Quantum ChemistryQuantum Chemistry
Quantum Chemistry
 
Superconductivity
SuperconductivitySuperconductivity
Superconductivity
 
Power Law Distributions for Twitter Data
Power Law Distributions for Twitter DataPower Law Distributions for Twitter Data
Power Law Distributions for Twitter Data
 
Chemiluminescence
ChemiluminescenceChemiluminescence
Chemiluminescence
 

Similar to A1 spyder variables_operators_nptel_pds1_sol

Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdfsimenehanmut
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Python For Machine Learning
Python For Machine LearningPython For Machine Learning
Python For Machine LearningYounesCharfaoui
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2docSrikanth
 
basics of python programming5.pdf
basics of python programming5.pdfbasics of python programming5.pdf
basics of python programming5.pdfPushkaran3
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfExaminationSectionMR
 
Question đúng cnu
Question đúng cnuQuestion đúng cnu
Question đúng cnuPhamHoc
 
Python_Unit_2.pdf
Python_Unit_2.pdfPython_Unit_2.pdf
Python_Unit_2.pdfalaparthi
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxvrickens
 

Similar to A1 spyder variables_operators_nptel_pds1_sol (20)

Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
Python For Machine Learning
Python For Machine LearningPython For Machine Learning
Python For Machine Learning
 
Apclass (2)
Apclass (2)Apclass (2)
Apclass (2)
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2doc
 
Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01
 
Aptitute question papers in c
Aptitute question papers in cAptitute question papers in c
Aptitute question papers in c
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
Functions.pdf
Functions.pdfFunctions.pdf
Functions.pdf
 
Functionscs12 ppt.pdf
Functionscs12 ppt.pdfFunctionscs12 ppt.pdf
Functionscs12 ppt.pdf
 
basics of python programming5.pdf
basics of python programming5.pdfbasics of python programming5.pdf
basics of python programming5.pdf
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdf
 
Question đúng cnu
Question đúng cnuQuestion đúng cnu
Question đúng cnu
 
Revision1 C programming
Revision1 C programmingRevision1 C programming
Revision1 C programming
 
Apclass (2)
Apclass (2)Apclass (2)
Apclass (2)
 
Apclass
ApclassApclass
Apclass
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
 
Python_Unit_2.pdf
Python_Unit_2.pdfPython_Unit_2.pdf
Python_Unit_2.pdf
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 

Recently uploaded

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 

Recently uploaded (20)

9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 

A1 spyder variables_operators_nptel_pds1_sol

  • 1. NPTEL PYTHON FOR DATA SCIENCE ASSIGNMENT SOLUTIONS (WEEK 1) 1. The command used to clear console in Spyder is:- Answer B - %clear – An easier way to clear the console in Python 2. Which of the following is a valid variable name? Answer C - ‘ram_2’ Alphanumeric is a valid variable name convention in Python. And supports a special character _ (underscore) Variable names should not begin or end with underscore even though both are allowed 3. Python files are saved with extension Answer A - .py 4. Which of the following statement is invalid? Answer B - m.n.q = 3500, 3600, 3700 Dot operators are used to access functions in Python, hence it is not used in naming a variable 5. The command to display an output in Python is:- Answer A and D – display() and print() 6. Assignment operator used in Python is: - Answer D – “=” (equal to)
  • 2. 7. Consider the variables a and b. Values of a and b are 280 and 15 respectively. The operation that will return a remainder is: - Answer B - a%b 8. Python command used to calculate 25 is given by:- Answer C - 2**5 9. The values of variables p and q are 15 and 3 respectively. What is the value of ‘p’ after running the code below? p*=q Answer D – 45
  • 3. 10. Which command would you use to find the data type of a variable Answer B – type () 11. Value of variable p is 45. Command to coerce p from integer datatype to float datatype is:- Answer B - p=float(p) 12. Indicate which command would you use to set the working directory. Answer B - os.chdir(“C:/Documents /Data”) 13. Comments in Python begin with Answer C - # 14. What type of object is x? x=(“Python”, “version”, “3.7”) Answer B - Tuple
  • 4. 15. Which of the following method can be used to initialize multiple variables with a common value? Answer B - Above 2 and 3 16. What will be the output after the following statements are executed? X=300 Y= 17 X%=Y print(X) Answer A - 11 17. What is the command to clear a single variable ‘a’ from the variable explorer? Answer C – del a
  • 5. 18. Which of the package is used for visualization in Python Answer D – ggplot, matplotlib, and seaborn are visualization packages for Python 19. “not in” belongs to which type of operator in Python? Answer A – membership Python’s membership operators (“in”, “not in”) test for membership in a sequence, such as strings, lists, or tuples 20. “is not” belongs to which type of operator in Python? Answer B – identity “is” and “is not” are the two identity operators - compares the memory locations of two objects. “is not” evaluates to false if the variables on either side of the operator point to the same object and true otherwise.