and Answers
What does the following program print?
a = "hi"
b=4
c=a*b
print type(c)
A. <type 'str'>
B. <type 'int'>
C. <type 'float'>
D. The program crashes and doesn't print anything. ✔️Correct Ans-A
Suppose you have a variable defined a = "4". What is the variable type of a?
A. str
B. int
C. float
D. number ✔️Correct Ans-A
, Choose the option that correctly prints out the variable(s).
A. x = "codehs"
print int(x)
B. num = 8
print "num"
C. name = "Alyx"
age = 32
print name + "is " + age
D. language = "Python"
print "I'm learning " + language ✔️Correct Ans-D
What kind of data does a float variable contain?
A. Whole numbers
B. Words
C. Numbers that can have decimal components
D. A float is not a Python variable type ✔️Correct Ans-C
What does the following code print?