Skip to content

Exercise

What to do?

  1. Write a program that takes an integer input n and prints the sum of all numbers from 1 to n.
  2. Develop a program that prompts the user to guess a secret number (between 1 and 100). Provide hints (higher/lower) for incorrect guesses and limit the number of attempts to 5.
  3. Create a program that generates the Fibonacci sequence up to a given number n.
  4. Write a program that continuously asks the user to enter a password. If the correct password ('password123') is entered, print a success message and break out of the loop.
  5. Create a program that prints all odd numbers from 1 to 20 but skips printing numbers divisible by both 3 and 5. In case a number is skipped, display a message indicating the skipped number and the reason it was skipped.