Question : W3Schools Var-Op-E 25

Below are 30 direct coding questions based strictly on the activities ahead of w3schools exam


  1. Write a program that stores 5 numbers in a list and prints the highest number.

  2. Write a program that prints the maximum number between 15 and 40.

  3. Create two variables for first name and last name, then print the full name using concatenation.

  4. Store a number as a string and print it with a dollar sign in front.

  5. Create a list of 4 items and print the first item in the list.

  6. Write a program that prints the index of the letter H in the word "Harmony".

  7. Create a list of numbers and check if 20 is not in the list.

  8. Write a program that removes the last item from a list and prints the new list.

  9. Write a program that removes the first item in a list using pop().

  10. Write a program that adds a new number to a list and prints the updated list.

  11. Write a program that asks the user for two numbers and divides them.

  12. Use try-except to prevent the program from crashing if the user enters letters instead of numbers.

  13. Use try-except to prevent division by zero.

  14. Write a program that adds two numbers and prints the result.

  15. Write a program that subtracts two numbers and prints the result.

  16. Write a program that multiplies two numbers and prints the result.

  17. Write a program that divides two numbers and returns a float result.

  18. Write a program that divides two numbers and returns a whole number using floor division.

  19. Write a program that finds the remainder when one number is divided by another.

  20. Write a program that raises one number to the power of another.

  21. Write a program that compares two ages and prints who is older.

  22. Write a program that prints the result of all comparison operators between two numbers.

  23. Write a program that creates 4 variables of different data types and prints each type.

  24. Write a program that prints two words separated by a dash (-).

  25. Write a program that prints a name and age in a sentence format.

  26. Write a program that adds a negative number and a positive number and prints the result.

  27. Write a program that stores 4 favorite games in a list and prints them.

  28. Write a program that prints how many items are in a games list.

  29. Write a program that prints the best game from a list using its index.

  30. Write a program that stores at least 5 friends’ names in a list and prints the first friend as “best friend”.

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