stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
More Python programming Flashcards | StudBud
Explore
/
More Python programming
More Python programming
20 terms
·
StudBud Administration
·
39 plays
A quiz on Python programming concepts taught in NC BP14 Python Programming I
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
What is the command for adding a library to python?
open
use
import
insert
2
Which of the following would print out:
My name is: "Mysterious"
?
print('My name is "Mysterious"')
print('My name is: Mysterious"')
print("My name is: \"Mysterious\"")
print("My name is:" \"Mysterious\"")
3
Which of the following is
not
the same as
iteration
?
start again
using a for loop
using a while loop
repetition
4
Which characters are always used to indicate a function
curly brackets { }
round brackets ( )
slashes / /
square brackets [ ]
5
How many times will this for loop run?
2
3
5
4
6
Which line of code is logically the same as the first two lines in this code snippet?
None of the choices in logically the same as the snippet.
If y > 11 and y < 0 :
if y < 11 or y > 0 :
if y > 0 and y < 11 :
7
What is a
for loop
an example of?
Variables
Selection
Iteration
Sequence
8
Which of the following will cause an error?
print ("the total is:", total - sale )
x = int("6") + 9.5 + int(6.5)
x = float(int(str(6) ) )
x = int (input("Enter the grade for", name) )
9
Which command will
not
correctly import the function
randint()
from random import randint
import random
from random import randint as r
import randint from random
10
Which command/keyword is used to create a function?
while
for
range
def
11
What is the name of the desktop computer Python integraded development environment (IDE)?
There is no IDE available for the desktop computer.
IDEP
PIDE
IDLE
12
Which character(s) is/are used to indicate an list?
curly brackets { }
square brackets [ ]
round brackets ( )
a colon :
13
What kind of Error will be generated?
There is no error. Code will run without any errors.
Index out of range error
indentation error
Type Error
14
How many times does this loop run?
7
6
9
8
15
Which of the following does NOT have a syntax error?
while x < 10
def myFunction():
print("hello)
for i range( ):
16
What is the current version of python ?
3.x
4.x
All of the versions listed are current.
2.x
17
Which of the following is used for exception handling?
if.....except()
try.....catch()
if....else.....
try.....except()
18
Which data structure is used to store several values in one variable?
a float variable
a list
an integer variable
a multipart variable.
19
What is the math operator for modulo (remainder) division?
Math.mod()
MOD
%
//
20
What will this code snippet print?
Nothing. There is a syntax error.
a= 15
a= 10
a= 5