1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is the formula to calculate the area of a rectangle?
Area = length * width
What is the formula to calculate the perimeter of a rectangle?
Perimeter = 2 * (length + width)
How do you request input from a user in Python?
Use the input() function to get input from a user.
What formula is used to calculate the area of a circle?
Area = 3.14 * radius^2
How do you determine if a number is even or odd in Python?
Use an if statement with the condition 'number % 2'.
What are the conditions for a year to be a leap year?
A year is a leap year if it is divisible by 4 but not by 100, or if it is divisible by 400.
How do you round a floating point number to two decimal places in Python?
Use the round() function with the second argument set to 2.
What is the purpose of a for loop in Python?
To iterate over a sequence (like a list or a range) and execute a block of code for each item.
What does a while loop do?
It repeatedly executes a block of code as long as a specified condition is True.
How do you define a function in Python?
Use the 'def' keyword followed by the function name and parentheses.
What is the mathematical representation of factorial?
N! = N * (N-1) * (N-2) * ... * 2 * 1.
How do you convert degrees Celsius to Fahrenheit in Python?
Use the formula F = (C * 9/5) + 32.
What does a dictionary in Python do?
It stores data in key-value pairs.
How do you create a list in Python?
Use square brackets [], with items separated by commas.
What is list comprehension?
A concise way to create lists using a single line of code with an expression inside square brackets.
How can you calculate the average of a list in Python?
Sum the elements of the list and divide by the number of elements.
What does 'distance_km' represent when converting from 'distance_miles'?
A list containing distances converted from miles to kilometers.