Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
Declare a variable named 'color' and assign it the value 'blue'. What will be the output of print(type(color))?
Remember, strings are enclosed in quotes.
What is the data type of the variable x = 100?
Think about whole numbers.
What is a variable in Python?
Think of how we store information.
Which function would you use to determine the type of a variable?
It's a built-in function!
Create a program that requests user input for their height as a string, converts it to a float, and outputs whether they are taller than 6 feet. How would you do this?
Ensure you convert the string input into a float.
You have two variables: temperature = '30' (string) and pressure = 101.5 (float). What would be the result of adding them as integers? Write the code and explain the output.
Pay close attention to the types before attempting addition!
5 more questions in this section. Enroll free to practise them all.
Enroll free