Unit 1 Question Preview (ID: 57126)

TechSmart Unit 1 Review.

What is a variable?
a) A container that holds information
b) The place where output appears
c) The difference between two values
d) A type of string literal

By default, user input is what data type?
a) string
b) integer
c) float
d) print

Can you concatenate a string and a float in the same print statement?
a) Yes
b) No
c) Yes, if you typecast the float to a string

To typecast an integer to a string you would wrap it in what function?
a) int()
b) float()
c) str()
d) print()

What is the data value type of 12.88
a) string
b) integer
c) float
d) print

int( ) is an example of what type of command?
a) Concatenation
b) Typecasting
c) Output
d) Interior

What does the print( ) command do?
a) It turns on the printer
b) It causes text output to appear in the console
c) It gets text input from the user
d) It adds the symbols ( ) to the end of a line

A statement is...
a) A way to make your code more fashionable
b) A line of code that begins with a # mark
c) A line of code that ends with a period
d) A line of code that performs some action

After this code executes, what is the value of the variable foo? foo = input(Hello) foo = World
a) Hello
b) World
c) Hello World
d) HelloWorld

float( ) is an example of what type of command?
a) output
b) math
c) concatenation
d) typecast

Which of the following pieces of code is an expression (produces a value)? Hint: An expression is partial code. It produces a value , but does nothing with it.
a) print(The value is 1)
b) x = 8
c) days += 7
d) Hello + World

In the following code statement, what is the data type of var? new_var = var + var​
a) string
b) integer
c) float
d) it could be any of them above

Which of the following is NOT an operator?
a) print()
b) +=
c) %
d) *

What is the correct operator to increment
a) +=
b) -=
c) =
d) ==

Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 57126 in the upper right hand corner or click here.

Log In
| Sign Up / Register