Skip to content

Instantly share code, notes, and snippets.

@ghostlyman
Last active February 26, 2016 04:05
Show Gist options
  • Save ghostlyman/4873ba0e1b09a99cf738 to your computer and use it in GitHub Desktop.
Save ghostlyman/4873ba0e1b09a99cf738 to your computer and use it in GitHub Desktop.

Revisions

  1. ghostlyman renamed this gist Feb 26, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. ghostlyman created this gist Feb 26, 2016.
    16 changes: 16 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/usr/bin/env python
    #Filename: Python_Course01_Q02_Gambling.py
    #This script is used for gambling an integer within 3 times.

    print('Hi, you have 3 times to guess the integer')
    INTEGER = 68
    for i in range(3):
    i = int(input('Please enter an integer: '))
    if i > INTEGER:
    print('Please guess a small one.')
    elif i < INTEGER:
    print('Please guess a big one.')
    elif i == INTEGER:
    print('Congratulation! You Win!')

    print('Oops! You fail!')