Podcast
Questions and Answers
Which one of these is the correct syntax to output the type of a variable or object in Python?
Which one of these is the correct syntax to output the type of a variable or object in Python?
- print(typeof variable)
- print(typeof(variable))
- print(typeOf(variable))
- print(type(variable)) (correct)
What is the correct syntax to output the type of a variable or object in Python?
What is the correct syntax to output the type of a variable or object in Python?
- print(variable.type())
- type.print(variable)
- print(type(variable)) (correct)
- printType(variable)
How do you create a variable with the floating number 2.8 in Python?
How do you create a variable with the floating number 2.8 in Python?
- variable = float(2.8) (correct)
- variable = 2.8f
- variable = 2.8
- float variable = 2.8