1、游戏操作如下: (1)后台预先生成一个1-100之间的随机数,用户键盘录入猜数字 (2)如果猜对了,打印“恭喜您,答对了” (3)如果猜错了 猜大了:打印“sorry,您猜大了!” 猜小了:打印“sorry,您猜小了!” (4)直到数字猜到为止 ...
分类:
其他好文 时间:
2017-12-21 01:50:38
阅读次数:
156
变量 name = "xiaochui" name2 = name print("My name is",name2) Myname is xiaochui name = "xiaochui" name2 = name name2直接指向"xiaochui" 不是先指向name name = "xi ...
分类:
其他好文 时间:
2017-12-19 15:28:36
阅读次数:
128
```python print(" 我爱鱼c工作室 ") temp = input("不妨猜一下小甲鱼现在心里在想哪个数字:")guess = int(temp)if guess == 8: print("我草,你是我肚子里的蛔虫吗?") print("哼,猜中了也没有奖励!")else: prin ...
分类:
其他好文 时间:
2017-12-12 23:52:46
阅读次数:
133
import randomnumber = random.randint(1,100)guess = 0while True: num_in = input("Input your number please:") guess += 1 if not num_in.isdigit(): print( ...
分类:
其他好文 时间:
2017-12-12 16:03:35
阅读次数:
150
循环:1.While循环while 条件: 语句eg:重试3次错误后退出count = 0
_number=15
while count <3:
guess_age = int(input("Guess&nb
分类:
编程语言 时间:
2017-12-11 17:12:38
阅读次数:
127
1、变量的赋值 字母被引号标注起来就是字符串,未被标注就是变量名 内存回收:创建的内存空间,当没有变量指向的时候,内存空间就会被清空或者直接删除。 比如:1.直接删除age=21del age2.取消指向age=22age=23 2.if语句实现猜年龄 3.多分支if语句 ...
分类:
编程语言 时间:
2017-12-10 22:51:52
阅读次数:
177
package Thread11; public class Guess { public static void main(String[] args) { // TODO 自动生成的方法存根 Number number = new Number(); number.giveNumberThrea ...
分类:
编程语言 时间:
2017-12-08 13:58:13
阅读次数:
249
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better tha... ...
分类:
编程语言 时间:
2017-11-26 11:06:10
阅读次数:
174
(define (sqrt-iter guess x) (if (good-enough? guess x) guess (sqrt-iter (improve guess x) x))) (define (improve guess x) (average guess (/ x guess))) ...
分类:
其他好文 时间:
2017-11-22 14:20:17
阅读次数:
113
age=36guessage=int(input('Please guess my age:'))while guessage!=age: if guessage<age: print('you need bigger') guessage=int(input('Please guess my ag ...
分类:
其他好文 时间:
2017-11-22 13:04:32
阅读次数:
130