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 'fruit' and assign it the value 'Mango'. What will be the output of print(fruit)?
Just use the variable name you assigned.
Create an integer variable 'quantity' and a float variable 'price'. Assign them values and print them. What types do you expect?
Remember what you learned about data types.
What is the result of type('Hello')?
Think about what type of data 'Hello' represents.
True or False: Variables can start with a number.
Recall the rules we discussed about naming variables.
Design a small program that calculates the area of a rectangle. The user inputs the length and width as floats. Store them in variables. Convert them as necessary to perform calculations, and then print the area.
Remember to ask for input and convert to float before calculating.
Create a variable to represent your age as a string, convert it to an int, and determine what year you were born in if the current year is 2023.
Think about how to extract the year from the current year minus your age.
6 more questions in this section. Enroll free to practise them all.
Enroll free