python day02 作业答案
1.
(1).false (2).false
2.
(1).8 (2).4
3.
(1).6 (2).3 (3).false (4).3 (5).true (6).true (7).0 (8).3 (9).0 (10).2
4.
(1).while True:
循环体
else:
跳出循环执行这里
5.
count=1
while 1:
number=input("猜猜我的数字:")
if int(number)==66:
print("回答正确")
break
elif int(number)< 66:
print("猜小了")
else :
print("猜大了")
6.
count=1
while 1:
number=input("猜猜我的数字:")
if int(number)==66:
print("回答正确")
break
elif count ==2:
print("太笨了")
count=count+1
7.
count=1
while count<=10:
print(count)
count+=1
8.
count=1
sum=1
while count<=99:
count += 1
sum=sum+count
print(sum)
9.
count=1
while count<=100:
if count %2!=0:
print(count)
count += 1
10.
count=1
while count<=100:
if count %2==0:
print(count)
count += 1
11.
sum=1
count=1
while count<99:
count=count+1
if count %2 ==0:
sum=sum-count
else :
sum=sum+count
12.
count=1
while count<=3:
username = input('请输入用户名:')
password = input("请输入密码:")
if username=='apple' and password =='':
print('登陆成功')
break
else :
print("登陆失败")
print("还剩"+str(3-count)+"次")
count=count+1
13.
14.
a='最'
b='第一'
c='稀缺'
d='国家级'
ad=input("输入广告:")
if (a or b or c or d) in ad:
print("不合法")
else:
print('合法')
python day02 作业答案的更多相关文章
- python day10作业答案
2.def func(*args): sum = 0 for i in args: sum=sum+int(i) return sum a=func(2,3,9,6,8) print(a) 3. a= ...
- python day09作业答案
2. def lst(input): lst2=[] count=0 for i in range(0,len(input)): if i %2!=0: lst2.append(input[i]) r ...
- python day08作业答案
1. a f=open('11.txt','r',encoding='utf-8') a=f.read() print(a) f.flush() f.close() b. f=open('11.txt ...
- python day07作业答案
1. sum=0 a=input() for i in a: sum=sum+int(i)**3 if sum==int(a): print('水仙数') 2. lst=[100,2,6,9,1,10 ...
- python day06 作业答案
1. count=1 while count<11: fen=input('请第{}个评委打分' .format( count)) if int(fen) >5 and int(fen) ...
- python day05 作业答案
1. b.不可以 c.tu=("alex",[11,22,{"k1":"v1","k2":["age" ...
- python day04 作业答案
1. 1) li=['alex','WuSir','ritian','barry','wenzhou'] print(len(li)) 2) li=['alex','WuSir','ritian',' ...
- python day02作业
- C#基础第八天-作业答案-设计类-面向对象方式实现两个帐户之间转账
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
随机推荐
- csu oj 1343 Long Long
Description 现在有两个单调递增序列,第一个序列有N个整数,第二个序列有M个整数,现在你可以从第一个序列中选一个数x,然后从第二个序列中选一个数y,那么有多少种情况满足x+y<=K呢? ...
- pycharm下打开、执行并调试scrapy爬虫程序
首先得有一个Scrapy项目,我在Desktop上新建一个Scrapy的项目叫test,在Desktop目录打开命令行,键入命令:scrapy startproject test1 目录结构如下: ...
- hdu 1025LIS思路同1257 二分求LIS
题目: Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others) Memory Limit ...
- Maximum sub array
Here I post a way to solve maximum sub array problem: The problem described like this: here is an ar ...
- JdbcTemplate查询返回JavaBean的几种方法
关于JdbcTemplate的官方描述如下: org.springframework.jdbc.core.JdbcTemplate 大约的讲,将JdbcTemplate返回的list结果集生成Java ...
- Mybatis 查询tinyint(1)的数据库字段时会自动转换成boolean类型
解决方案:将字段的tinyint(1)变成tinyint(2)
- python中json的使用
在编写接口传递数据时,往往需要使用JSON对数据进行封装.python和json数据类型的转换,看作为编码与解码. 编码:json.dumps() Python JSON dict object li ...
- 【LeetCode】Permutation全排列
1. Next Permutation 实现C++的std::next_permutation函数,重新排列范围内的元素,返回按照 字典序 排列的下一个值较大的组合.若其已经是最大排列,则返回最小排列 ...
- qq远程连接/windows远程桌面/teamviwer/xmanager/vnc的区别
软件 客户端运行平台 服务端运行平台 服务端是否需要同子网或公网IP 网络断开当前执行命令是否会中止 评价 QQ远程连接 windows windows 否 否 感觉用了一两分钟就动不了了 windo ...
- MySQL设置白名单教程
1 登录mysql mysql -h host -u username -p password 2 切换至mysql库 use mysql; 3 查看当前允许登录IP及用户 select Host,U ...