• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

Python Exam 1 - Spring 2025 Correctly Answered.

Document preview thumbnail
Preview 2 out of 12 pages

Python Exam 1 - Spring 2025 Correctly Answered. T/F: Python was created by Guido van Rossum in the late 1980s - CORRECT ANSWER True T/F: Python is a low-level programming language focusing primarily on system operations and memory management. - CORRECT ANSWER False. Python is a high-level programming language T/F: Pythons syntax allows programmers to write programs with fewer lines than some other programming languages - CORRECT ANSWER True T/F: Python is only suitable for web development and cannot be used in data science - CORRECT ANSWER False. Python is widely used in web development, data science, machine learning, and more. Python is a proprietary software, and obtaining it requires a purchase. - CORRECT ANSWER False. Python is open-source T/F: In python, variables must be declared before they are assigned a value. - CORRECT ANSWER False. Python does not require explicit variable declarations before assignment T/F: The assignment operator in Python is == - CORRECT ANSWER False. The assignment operator in Python is = T/F: Python variables are case-sensitive. - CORRECT ANSWER True T/F: Python allows using reserved words as variable names. - CORRECT ANSWER False. Reserved words cannot be used as variables names T/F: The ** operator in python is used for multiplication. - CORRECT ANSWER False. The ** operator is used for exponentiation. T/F: Python uses the = operator for both assignment and equality check. - CORRECT ANSWER False. The = is used for assignment, while == is used for equality check. T/F: The input() function in python always returns a value of the string type. - CORRECT ANSWER True T/F: In python, the += operator is used to subtract a value from a variable - CORRECT ANSWER False. The += operator is used to add a value to a variable. T/F: Type casting can change a variable from an int type to a string type - CORRECT ANSWER True. T/F: Lists in python can only contain elements of the same data type. - CORRECT ANSWER False. Lists contain elements of different data types T/F: The first element in a Python list is 1. - CORRECT ANSWER False. The index of the first element is 0. T/F: Python lists are immutable. - CORRECT ANSWER False. Lists are mutable, meaning their elements can be changed. T/F: You can us negative indexing to access elements from the end of a list in Python. - CORRECT ANSWER True. T/F: The len() function can be used to find the number of elements in a list. - CORRECT ANSWER True. T/F: The elif statement can only be used after an else statement. - CORRECT ANSWER False. The elif statement is used after an if statement and before an else statement T/F: In Python, if statements cannot be nested within another if statement. - CORRECT ANSWER False. If statements can be nested within another if statement. T/F: The else statement is executed only if the if statement's condition is true. - CORRECT ANSWER False. The else statement is executed when the if statement's condition is False. T/F: Python requires parentheses around the condition in an if statement. - CORRECT ANSWER False. Parentheses are not required around the condition in an if statement in python, though they can be used for clarity.

Content preview

Python Exam 1 - Spring 2025 Correctly
Answered.

T/F: Python was created by Guido van Rossum in the late 1980s - CORRECT ANSWER True



T/F: Python is a low-level programming language focusing primarily on system operations and memory
management. - CORRECT ANSWER False. Python is a high-level programming language



T/F: Pythons syntax allows programmers to write programs with fewer lines than some other
programming languages - CORRECT ANSWER True



T/F: Python is only suitable for web development and cannot be used in data science - CORRECT
ANSWER False. Python is widely used in web development, data science, machine learning, and more.



Python is a proprietary software, and obtaining it requires a purchase. - CORRECT ANSWER False.
Python is open-source



T/F: In python, variables must be declared before they are assigned a value. - CORRECT ANSWER False.
Python does not require explicit variable declarations before assignment



T/F: The assignment operator in Python is == - CORRECT ANSWER False. The assignment operator in
Python is =



T/F: Python variables are case-sensitive. - CORRECT ANSWER True



T/F: Python allows using reserved words as variable names. - CORRECT ANSWER False. Reserved words
cannot be used as variables names



T/F: The ** operator in python is used for multiplication. - CORRECT ANSWER False. The ** operator is
used for exponentiation.

, T/F: Python uses the = operator for both assignment and equality check. - CORRECT ANSWER False. The
= is used for assignment, while == is used for equality check.



T/F: The input() function in python always returns a value of the string type. - CORRECT ANSWER True



T/F: In python, the += operator is used to subtract a value from a variable - CORRECT ANSWER False.
The += operator is used to add a value to a variable.



T/F: Type casting can change a variable from an int type to a string type - CORRECT ANSWER True.



T/F: Lists in python can only contain elements of the same data type. - CORRECT ANSWER False. Lists
contain elements of different data types



T/F: The first element in a Python list is 1. - CORRECT ANSWER False. The index of the first element is 0.



T/F: Python lists are immutable. - CORRECT ANSWER False. Lists are mutable, meaning their elements
can be changed.



T/F: You can us negative indexing to access elements from the end of a list in Python. - CORRECT
ANSWER True.



T/F: The len() function can be used to find the number of elements in a list. - CORRECT ANSWER True.



T/F: The elif statement can only be used after an else statement. - CORRECT ANSWER False. The elif
statement is used after an if statement and before an else statement



T/F: In Python, if statements cannot be nested within another if statement. - CORRECT ANSWER False. If
statements can be nested within another if statement.



T/F: The else statement is executed only if the if statement's condition is true. - CORRECT ANSWER
False. The else statement is executed when the if statement's condition is False.

Document information

Uploaded on
April 6, 2025
Number of pages
12
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ROSEGRADES
3.4
(35)
Sold
236
Followers
87
Items
12121
Last sold
3 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions