This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>repl.it</title> | |
<link href="style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Improved code | |
import random | |
first = 1 | |
last = 10 | |
number = random.randint(first, last) | |
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
first = 1 | |
last = 10 | |
number = random.randint(first, last) | |
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": ")) | |
while number != guess: | |
if guess < number: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
first = 1 | |
last = 10 | |
number = random.randint(first, last) | |
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": ")) | |
while number != guess: | |
if guess < number: |