- Study guides, Class notes & Summaries
Looking for the best study guides, study notes and summaries about ? On this page you'll find 9 study documents about .
9 results
Exam (elaborations)
PYTHON exam 2023 with 100% correct answers
The following code represents a ________________ if structure. 
 
if a >= 1: 
if a == 1: 
nested 
 
 
 
Which line of code sets the value of the variable take_home to 500? 
take_home == 1500 / (1 + 2) 
take_home = 250 * 6 / 1 + 2 
take_home = 250 * (5 % 3) 
take_home = 250 * 5 - 3 
take_home = 250 * (5 % 3) 
 
 
 
Given the code 
message = "Your percentage score of " 
percentage = "95.6" 
letter_grade = "% is an A grade." 
 
What is the correct code to display the following result? 
You...
Exam (elaborations)
python exam 1 2023 with 100% correct answers
PopularWhere does a computer store a program and the data that the program is working with while the program is running? 
Main memory 
 
 
 
What is the encoding technique used to store positive and negative integers in the computer's memory? 
Two's-complement 
 
 
 
How many different values can a single byte take? 
256 
 
 
 
Which is a secondary storage device that has no moving parts, and is faster than a traditional disk drive? 
Solid state drive 
 
 
 
The CPU is able to quickly access data sto...
Exam (elaborations)
PYTHON exam with 100% correct answers 2024
The following code represents a ________________ if structure. 
 
if a >= 1: 
 if a == 1: correct answers nested 
 
Which line of code sets the value of the variable take_home to 500? 
take_home == 1500 / (1 + 2) 
take_home = 250 * 6 / 1 + 2 
take_home = 250 * (5 % 3) 
take_home = 250 * 5 - 3 correct answers take_home = 250 * (5 % 3) 
 
Given the code 
message = "Your percentage score of " 
percentage = "95.6" 
letter_grade = "% is an A grade." 
 
What is the correct code to display...
Exam (elaborations)
Python exam review exam with 100% correct answers 2024
how do we add a list to a list? correct answers list[2] = [1, 2, 3] 
 
how do we ad elements of a list to a list? correct answers list[2:2] = [1,2,3] 
 
how do we delete elements from a list? correct answers del list[1] 
 
what's another way of deleting elements from a list, besides del? correct answers list[1] = [] 
 
what does 3 * [0] return? correct answers [0,0,0] 
 
if you really want to copy a list, what can you do? correct answers list2 = list1[:] 
 
difference between append and e...
Exam (elaborations)
Python Exam 2023 with 100% correct answers
Which of the following statements is true about comments in coding? 
Comments are a form of communication with other programmers (including yourself) 
 
 
 
In the following line of Python code, what is the argument to the input function? 
user_status = input("How are you today?") 
"How are you today?" 
 
 
 
Which symbol is used to assign a value to a variable in Python? 
= 
 
 
 
Which of the following is not a valid variable name in Python? 
my_2_cents 
 
 
 
In Python, whole numbers like...
Exam (elaborations)
Python Exam 2023 with 100% correct answers
Which of the following is correct about Python? 
 
a. Python is a high-level, interpreted, interactive and object-oriented scripting language. 
b. Python is designed to be highly readable. 
c. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. 
d. All of the above 
d. All of the above. 
 
 
 
Is Python case sensitive when dealing with identifiers? 
 
a. yes 
b. no 
c. it depends on context 
d. it depends ...
Exam (elaborations)
python exam 1 2023 with 100% correct answers
algorithm 
A set of specific steps for solving a category of problems 
 
 
 
comment 
Text in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program 
 
 
 
high-level language 
A programming language like Python that is designed to be easy for humans to read and write. 
 
 
 
print 
A function used in a program or script that causes the Python interpreter to display a value on its output device. 
 
 
 
runtime error 
An...
Exam (elaborations)
Python Exam 2023 with 100% correct answers
Which of the following are operators, and which are values? 
* 
'hello' 
-88.8 
- 
/ 
+ 
5 
The operators are +,-,*,and /. The values are 'hello' ,-88.8, and 5. 
 
 
 
Which of the following is a variable , and which is a string ? 
spam 
'spam' 
The variable is spam; the string is 'spam'. Strings always start and end with quotes. 
 
 
 
Name three data types. 
The three data types are integers, floating point numbers, and strings. 
 
 
 
What is an expression made up of ? What do all exp...
Exam (elaborations)
Python Exam 2023 with 100% correct answers
1. Which of the following data types are supported in Python? 
The following data type are Supported: 
1 - Numbers 
2 - String 
3 - List 
4 - Tuples 
5 - Dictionary 
 
 
 
2. Which of the following data types are not supported in Python? 
Slice 
 
 
 
3. What is the output of print(str) if str = 'Hello World!'? 
Hello World! 
 
 
 
4. What is the output of print(str[0]) if str = 'Hello World!'? 
H 
 
 
 
5. What is the output of print(str[2:5]) if str = 'Hello World!'? 
llo 
 
 
 
6. What ...