AttributeError:"module"对象没有属性"randit"
选择 | 换行 | 行号
- import random
- print('Welcome to Guess the Number')
- print('Try to guess the number in as few tries as possible')
- the_number= random.randit(1, 100)
- guess=int(input('Take a guess! '))
- tries=1
- while guess != nbum:
- if guess>the_number:
- print('Lower... ')
- else:
- print('Higher... ')
- guess= int(input('Take a guess! '))
- tries+=1
- print('Well done! The number was', the_number)
- print('and it only took u=you', tries, 'tries!')
- input('n/nPress the enter key to exit')