fixed #4
This commit is contained in:
11
Pipfile
Normal file
11
Pipfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[[source]]
|
||||||
|
name = "pypi"
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
python_version = "3.8"
|
||||||
20
Pipfile.lock
generated
Normal file
20
Pipfile.lock
generated
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "7f7606f08e0544d8d012ef4d097dabdd6df6843a28793eb6551245d4b2db4242"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {
|
||||||
|
"python_version": "3.8"
|
||||||
|
},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {},
|
||||||
|
"develop": {}
|
||||||
|
}
|
||||||
0
app/__init__.py
Normal file
0
app/__init__.py
Normal file
2
app/config.py
Normal file
2
app/config.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# 16 quadrillion
|
||||||
|
MAX_NUM = 16_000_000_000_000_000
|
||||||
@@ -1,12 +1,24 @@
|
|||||||
# copyright 2020 Simon Averbach and Zev Averbach
|
# copyright 2020 Simon Averbach and Zev Averbach
|
||||||
|
from config import MAX_NUM
|
||||||
|
|
||||||
|
|
||||||
def math_game():
|
def math_game():
|
||||||
|
for i in range(100):
|
||||||
|
print()
|
||||||
print("Hi, welcome to math game!")
|
print("Hi, welcome to math game!")
|
||||||
print("How high do you want to count?")
|
print("How high do you want to count?")
|
||||||
number = int(input("> "))
|
number = int(input("> "))
|
||||||
|
while number > MAX_NUM:
|
||||||
|
print(f"Sorry, there's a limit of {MAX_NUM:,}")
|
||||||
|
print("How high do you want to count?")
|
||||||
|
number = int(input("> "))
|
||||||
print("How much do you want to add each time?")
|
print("How much do you want to add each time?")
|
||||||
each = int(input("> "))
|
each = int(input("> "))
|
||||||
print(f"Okay, here we go! We're going to count from zero to {number} by {each} at a time.")
|
print(f"Okay, here we go! We're going to count from zero to {number} by {each} at a time.")
|
||||||
sleep(3)
|
sleep(3)
|
||||||
for i in range(0, number, each):
|
for i in range(0, number, each):
|
||||||
print(f"{i:,}")
|
print(f"{i:,}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
math_game()
|
||||||
Reference in New Issue
Block a user