# def tick_tock(): # # return; # # def odd_elems(elem_list): # # return updated_list; # # def cycle(a, b, c, n): # # return; # # def remove_duplicates(initial_string): # # return updated_string; def guessing_game(): import random int_to_guess = random.randint(1, 100) print("Can you guess the number?") while True: guess = raw_input("Give it a shot:") if guess < int_to_guess: print("Too low!") if guess > int_to_guess: print("Too high!") if guess == int_to_guess: print("Congratulations, you're the 1,000,000th winner!") break return;
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question