Skip to content
Snippets Groups Projects
Commit 47c5f0d3 authored by Renson Olivier's avatar Renson Olivier
Browse files

number_guessing dict update

parent d66998d6
No related branches found
No related tags found
No related merge requests found
...@@ -24,10 +24,8 @@ def play(): ...@@ -24,10 +24,8 @@ def play():
while again: while again:
level = input('Select a level of difficulty [easy/pro/legend] : ') level = input('Select a level of difficulty [easy/pro/legend] : ')
if level == 'easy': max = 20 levels = {'easy':20, 'pro':200, 'legend':500}
elif level == 'pro': max = 200 max = levels.get(level, 100)
elif level == 'legend': max = 500
else: max = 100
random_nb = randint(0, max) random_nb = randint(0, max)
history = [] history = []
......
...@@ -46,9 +46,8 @@ def play(): ...@@ -46,9 +46,8 @@ def play():
while again: while again:
level = user_input('Select a level of difficulty [easy/pro/legend] : ', level = user_input('Select a level of difficulty [easy/pro/legend] : ',
'easy', 'pro', 'legend') 'easy', 'pro', 'legend')
if level == 'easy': max = 20 levels = {'easy':20, 'pro':200, 'legend':500}
elif level == 'pro': max = 100 max = levels.get(level, 100)
elif level == 'legend': max = 500
random_nb = randint(0, max) random_nb = randint(0, max)
history = [] history = []
......
...@@ -126,10 +126,8 @@ def play(): ...@@ -126,10 +126,8 @@ def play():
while logged and again: while logged and again:
level = user_input('Select a level of difficulty [easy/pro/legend] : ', level = user_input('Select a level of difficulty [easy/pro/legend] : ',
'easy', 'pro', 'legend') 'easy', 'pro', 'legend')
if level == 'easy': max = 20 levels = {'easy':20, 'pro':200, 'legend':500}
elif level == 'pro': max = 100 max = levels.get(level, 100)
elif level == 'legend': max = 500
else: max = 100
random_nb = randint(0, max) random_nb = randint(0, max)
history = [] history = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment