Unit 1 Question Preview (ID: 57126)
TechSmart Unit 1 Review.
TEACHERS: click here for quick copy question ID numbers.
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
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
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
int( ) is an example of what type of command?
a) Concatenation
b) Typecasting
c) Output
d) Interior
What is the data value type of 12.88
a) string
b) integer
c) float
d) print
To typecast an integer to a string you would wrap it in what function?
a) int()
b) float()
c) str()
d) print()
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
d)
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
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.
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.
TEACHERS / EDUCATORS
Log In | Sign Up / Register
Log In | Sign Up / Register