Below are 30 direct coding questions based strictly on the activities ahead of w3schools exam
Write a program that stores 5 numbers in a list and prints the highest number.
Write a program that prints the maximum number between
15and40.Create two variables for first name and last name, then print the full name using concatenation.
Store a number as a string and print it with a dollar sign in front.
Create a list of 4 items and print the first item in the list.
Write a program that prints the index of the letter H in the word
"Harmony".Create a list of numbers and check if
20is not in the list.Write a program that removes the last item from a list and prints the new list.
Write a program that removes the first item in a list using
pop().Write a program that adds a new number to a list and prints the updated list.
Write a program that asks the user for two numbers and divides them.
Use
try-exceptto prevent the program from crashing if the user enters letters instead of numbers.Use
try-exceptto prevent division by zero.Write a program that adds two numbers and prints the result.
Write a program that subtracts two numbers and prints the result.
Write a program that multiplies two numbers and prints the result.
Write a program that divides two numbers and returns a float result.
Write a program that divides two numbers and returns a whole number using floor division.
Write a program that finds the remainder when one number is divided by another.
Write a program that raises one number to the power of another.
Write a program that compares two ages and prints who is older.
Write a program that prints the result of all comparison operators between two numbers.
Write a program that creates 4 variables of different data types and prints each type.
Write a program that prints two words separated by a dash (
-).Write a program that prints a name and age in a sentence format.
Write a program that adds a negative number and a positive number and prints the result.
Write a program that stores 4 favorite games in a list and prints them.
Write a program that prints how many items are in a games list.
Write a program that prints the best game from a list using its index.
Write a program that stores at least 5 friends’ names in a list and prints the first friend as “best friend”.
