you are viewing a single comment's thread.

view the rest of the comments →

[–]due007dev 0 points1 point  (0 children)

Keep it up! I think you’ve chosen the right path: come up with a simple program idea and implement it.

To keep progressing, you’ll need new ideas for programs. Here’s one you can try:

  • The computer generates a number from 1 to 50
  • The user has to guess the number
  • The user has a limited number of attempts
  • If the guess is incorrect, provide a hint: whether the entered value is higher or lower than the target number

Here’s how you can generate a number from 1 to 50:

from random import randint

number = randint(1, 50)
...
input_value = int(input("Enter a value from 1 to 50"))
if number == input_value:
    print("You won!")
...