登录后查看本帖详细内容!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
4.1:<,<=,>,>=,==,!= 4.2:1 0 True False 4.3:random.randint(0,19) 4.4:random.randint(10,19) 4.5:random.randint(10,50) 4.6:random.randint(0,1) 4.7: If y > 0: X=1 4.8:if score > 90: Pay*=1.03 4.9:if score > 90: Pay*=1.03 Else: Pay*=1.01 4.10:a错误,b输出:30:30 is even;35:35 is odd 4.11:a、x is 3 b、z is 7 c、无输出 4.12:a、x is 2 b、无输出 c、z is 6 4.13:顺序反了,应先判断>=90的情况 4.14:没有等价的,b、c、d都是不正确缩进 4.15:newline=count %10==0 4.16:b更好,因为包含的更全面 4.17:number=14:14 is even Number=15:15 is multiple of 5 Number=30:a、30 is even ;30 is multiple of 5 B、30 is even 4.18:相同 4.19:输入在判断范围之外 4.20:False False True True True True 4.21 num>1 and num<100 4.22 (num>1 and num<100) or num<0 4.23:Flase Ture Ture Ture 4.24:等价 4.25:‘A’, ‘E’ 4.26:x<y and y<zis 2<3 and 3<6 X<y or y<z is 2<3 or3<6 Not (x<y) is Flase X<y<z is 2<3<6 Not(x<y<z) is Flase 4.27:13<age<18 4.28:weight>50 or height<160 4.29:weight>50 and height<160 4.30: (weight>50 or height<160 ) andnot (weight>50 and height<160) 4.31:sorted 4.32:ticketprice=20 if ages>=16 else 10 Print(Count if count%10==0 else count,end=’’) 4.33:a:if x>10: Score=3*score Else: Score=4*score B: ifincome>10000: Tax=income*0.2 Else: Tax=income*0.17+1000 C:ifnumber%3==0: Print(i) Else: Print(j) 4.34:Ture Ture 4.35:对 4.36:flase Flase 4.37:不一样;不一样;一样
|