Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Declare a variable color and assign it a favorite color.
Use the format variable_name = value.
What type of data does age = 30 hold?
Think about whether it's whole or decimal.
What is the purpose of the type() function?
Think about what you would want to check about a variable.
True or False: Variable names can start with a number.
Recall the naming rules for variables.
You have data collected from a survey where ages are accidentally stored as strings. Write a function that takes a list of ages as strings and returns a new list with the ages converted to integers.
Consider using list comprehension for efficient conversion.
Create a Python program that takes input for two users' names and favorite numbers. Swap the values, then print out the new values along with their types.
Don’t forget to capture inputs as strings and then convert them as necessary.
4 more questions in this section. Enroll free to practise them all.
Enroll free