Guess number game created in Python

in #python6 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.28
TRX 0.12
JST 0.033
BTC 69626.36
ETH 3667.86
USDT 1.00
SBD 3.82