Question : W3Schools Var-Op-A 24

 

1. Addition Practice

Create two integer variables and find their sum. Print the result.

2. Subtraction Task

Store two numbers in variables and print the difference between them.

3. Multiplication Challenge

Save two values and print the product in a full sentence (e.g., “The answer is …”).

4. Float Division Test

Create two numbers and print their float division result with a label.

5. Floor Division Test

Use floor division to show how Python cuts off the decimal part. Print the answer.

6. Modulus Task

Ask the student to check the remainder when a number is divided by another.

7. Exponent Task

Raise one number to the power of another and print the result.

8. Compare Two Ages

Create two age variables and check:

  • who is older,

  • whether they are equal in age.

9. Boolean Check

Compare two numbers using all comparison operators (==, !=, >, <, <=, >=) and print the results in sentences.

10. Variable Naming Rules

Write 5 correct variable names and 5 wrong ones as comments.
(No code execution needed—just write them.)

11. Create 4 Variables of Different Data Types

One string, one integer, one float, and one boolean.
Print all in one print statement using commas.

12. String Printing Task

Store your name and favourite color, then print them on one line separated by a hyphen using sep='-'.

13. Sentence Building With Variables

Create a variable for name and age. Use print(name, 'is', age) to form a complete sentence.

14. Commenting Practice

Write 3 lines of Python code, but comment out one line.
The task is to show your understanding of comments.

15. Negative Number Arithmetic

Use a negative number in an arithmetic expression and print the result of + and -.

16. Check Data Types

Create four variables (string, int, float, boolean).
Print a sentence describing each type (e.g., “age is an integer”).

17. Python Keywords Mistake Task

Write 3 wrong variable names (using keywords).
Then correct them underneath.

18. Case Sensitivity Demonstration

Create two variables: name and Name with different values.
Explain (in comments) why Python treats them as different.

19. Separator Practice

Print three random items using custom separators:

  • one with /

  • one with *

  • one with spaces

20. Real-Life Arithmetic Task

Create variables for price of an item and quantity bought.
Calculate and print total cost using multiplication.

Write what you are looking for, and press enter to begin your search!