stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python 1 20 Questions Flashcards | StudBud
Explore
/
Python 1 20 Questions
Python 1 20 Questions
21 terms
·
StudBud Administration
·
178 plays
A quiz on Python programming concepts taught in NC BP14 Python Programming I
Flashcards
21 cards
F
Practice quiz
P
Host live
L
Questions
21
Answers
1
If the user inputs 38 what will be the output from this code?
48
TypeError
1038
10answer
2
What is printed by the following code?
numbers 9 to 1
numbers 0 to 10
nothing is printed
number 10 to 0
3
What is the output of
print ("title".istitle() )
title
TITLE
True
False
4
Which statement sets the variable
s
to "NC"
s = "NC"
s == "NC"
"s" = NC
s = NC
5
If the user enters the number 8, what is the output of the following code?
The result is s+10
The result is 810
TypeError
The result is 18
6
What is the output of the following code?
None
NameError
4
Syntax error
7
What is the output of the following code?
"x * 2"
Syntax error
3
6
8
What is the output from the following code?
True
False
d in name.lower()
TypeError
9
What does
type (4/2)
return?
float
TypeError
int
2
10
What is the output of the following code?
ab
nothing
aceg
bdf
11
What is the output of
print (10%3)
?
3.3333
1
3.0
3
12
What is the output of the following code?
the addition of all odd numbers
the total of all numbers divided by two
"y"
the addition of all even numbers 0 to 10
13
What data type does the
input ()
function return?
a Boolean value
an integer value
a float value
a string value
14
What is the output from the following code?
each animal printed on a new line in reverse order.
all the animals printed on one line
each animal printed on a new line
pig
15
What is the output of the following code?
gfedcba
aceg
nothing is printed
abcdefg
16
What is output from the following code?
DoNaLd DuCk
Donald Duck
dONALD dUCK
donald duck
17
Which of the following is True?
Python variables are case sensitive
Python variables are always strings
Python variable cannot be changed by the program
Python variables can start with a number
18
The
type()
function is used to change from one data type to another
False
True
19
Which operator can be used to
concatenate
two strings?
+
/
!
-
20
Which of the following is a Python
function
?
s = "Hello World!"
def
print ()
x = 4
21
What is the output from the following code?
33
TypeError
False
True