Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Create a variable fruit and assign it the value 'Mango'. What is its type?
Use the type() function to find out.
What will print(type(3.14)) output?
Think about the number type.
What does the type() function do?
Think about what information you get from a variable.
True or False: The data type of a variable cannot change in Python.
Remember dynamic typing!
Write a program that asks for a user's name, age, and height. Display the types of all inputs and convert the age to a string and back to an integer.
Look at how the input function works.
Create a function that takes a string representation of a number and returns its integer value. Use type() to confirm its type.
Dwell on the conversion process in your function.
5 more questions in this section. Enroll free to practise them all.
Enroll free