Guess number game created in Python

in #python7 years ago

Are you interested in Python? I do.
Well, if you want to create a script to guess number with computer, you can create the script in Python as follows, enjoy!

#!c:\python27

-- coding:UTF-8 --

print "If necessary,please set the path:%s\n" % '[Environment]::SetEnvironmentVariable("Path","$env:Path;C:\Python27","User")'

import random

Number_Int = int(random.uniform(1,10))

print "Are you ready? Let's begin."
player = raw_input('Hi,what is your name:')

Input_Int = int(input('Please enter an integer number:'))

while Input_Int!=Number_Int:
if Input_Int>Number_Int:
print('Too large')
Input_Int = int(input('Please enter an integer number:'))
if Input_Int<Number_Int:
print('Too small')
Input_Int = int(input('Please enter an integer number:'))
if Input_Int==Number_Int:
print "%s,congratulations!You win!"% player
break

Coin Marketplace

STEEM 0.21
TRX 0.25
JST 0.039
BTC 95276.42
ETH 3297.99
USDT 1.00
SBD 3.16