Question 1
Which function displays text in Python?
-
print() -
input() -
len() -
range()
Review Python questions for Computer Science, with correct answers shown and coverage across variables and data types; selection and iteration; functions and parameters.
print()
input()
len()
range()
input()
print()
int()
str()
#
//
/*
@
=
==
:
+
==
=
!=
>=
int
str
float
bool
str
int
float
bool
len("cat")?0
items = [1, 2]; items.append(3), what is items?[1, 2, 3]
[3, 1, 2]
[1, 2]
[1, 2, [3]]
for
while
if
def
range(3)?if
for
import
return
if condition is false. Which branch runs?else
if
for
while
bool
int
str
list
int("5") return?5
"5"
5.0
def
function
proc
return
return do in a Python function?"cat".upper() return?"CAT"
"cat"
"Cat"
while
for
if
print
import
include
load
module
[10, 20, 30][1] return?sum([2, 3]) return?A and B true?list
tuple
set
dict
"cat"[1:] return?"at"
"c"
"ca"
"cat"
!=
=
==
<=
input() return?str
int
bool
list
Review Python questions for Computer Science, with correct answers shown and coverage across variables and data types; selection and iteration; functions and parameters.