stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CSC119 Final Exam Review : PYTHON Flashcards | StudBud
Explore
/
CSC119 Final Exam Review : PYTHON
CSC119 Final Exam Review : PYTHON
30 terms
·
StudBud Administration
·
19 plays
Career Start Cybersecurity Year II Python Programming Course Final Exam Review
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
Which variable name follows Python naming conventions best?
UserFirstName
userFirstName
Bob
USERFIRSTNAME
2
What is vAR in
def fun(vAR):
argument
function
return value
constant
3
print(os.path.exists("c:\WINDOWS\system33"))
False
if i != lamer
True
No.
4
What can you use to verify your code works before compiling?
Pyromancy
Beta testers
Debugger
Trace tables
5
What is the value of
"YEET" <= "yeet"
?
ERROR!
True
Yoink
False
6
How are lists different from other variables?
They're mutable
They're passed by reference
They're passed by value
TRICK QUESTION!?!
7
Which of these is a spreadsheet format accessible in Python?
CSV
UwU
SHT
SVG
8
What is the output of this line of code:
# print("My name is" + userName):
It's a comment, dummy
Depends on the value of userName
Runtime Error
Compiler Error
9
Which of these is a legal variable name?
3rdVariable
Float
tHiSIstHerIGhTanSwEr
My-Variable
10
Yellow?
(0,0,255)
(0,255,0)
(255,255,0)
(255,0,0)
11
What's the result of
21//4
?
5
194481
17
1
12
What's wrong with this function definition:
def function(argument1)
function is a reserved keyword
Def should be capitalized
It's missing a colon
Variable names cannot contain numbers
13
Which is a valid Boolean value?
FALSE
true
False
"True"
14
Which of these is not a Python component?
Disambiguator
Virtual Machine
Interpreter
Editor
15
What is true about Python?
Python registration fees are expensive
It's more fun than a poke in the eye
Code must be rewritten for each hardware platform
Code is compiled, not interpreted
16
What is
bar
in
baz = foo.bar()
option
constructor
argument
method
17
What is true of a variable named
VAR1
?
It is an integer
It must be initialized
It has global scope
It cannot be rewritten
18
What's the result of
3**4
?
81
1
12
7
19
What advantage(s) do programming languages like Python have over Assembly and Machine Languages?
They run faster
Smaller Executables
Easier to understand
Autocorrecting code
20
What is the output of
print([1,2,3]+[4,5,6])
?
TypeError
[5,7,9]
[1,2,3]+[4,5,6]
[1,2,3,4,5,6]
21
Give
list = ( 0, 1, 1, 2, 3, 5, 8 )
, what is the value of
list(4)
?
2
3
(0,1,1,2)
TypeError
22
An
if
statement generates what in Python?
decision
inequality
exception
loop
23
Which code snippet will multiply the elements of a list by another variable, and save the result in another variable?
for i in list1: var3[i] = list[i] * var2
var3 = list1 * var2
var3 = [ i * var2 for i in list1]
var3[i] = var2 * list1[0:i]
24
Where are programs and data stored while running?
System Bus
Secondary Storage
Primary Storage
In their shoes, duh.
25
Which is true?
10 != 10
10 = 10
10 <= 10
10 + 10
26
Which is generated by the Python compiler?
input files
source code
byte code
executable files
27
Which code snippet is an example of an increment?
def c(d, e, f):
b = b+1
a = 100
g = h.i(j)
28
Which file extension indicates that Python will run without opening the console window?
.py
.pyw
.nopy
.min
29
Which code snippet creates an empty tuple named foo?
foo = []
foo = {}
foo = ""
foo = ()
30
How do you close a file named inputFile.txt?
close("inputFile.txt")
inputFile.txt.close()
I don't know enough
open("inputFile.txt",c)