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 ...
随机推荐
- rsync未授权访问漏洞利用
漏洞描述:rsync是Linux系统下的数据镜像备份工具,使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他ssh,rsync主机同步.也就是说如果你可以连接目标IP的r ...
- 【IDEA】【3】操作使用
前言: 1,显示工具栏及底部周边工具栏 2,修改项目名称 3,文件重命名 4,鼠标移动到方法上时进行提示注释 5,修改文件后自动重启 6,查看代码覆盖率 正文: 1,显示工具栏及底部周边工具栏 Vie ...
- 兼容IE8的video写法
<video width="100%" height="515px" controls preload> <source src=" ...
- rac备份及恢复的重要概念之一——Redo Threads和Streams
rac数据库的备份和恢复,与单实例Oracle数据库的备份和恢复没有根本的不同,但区别还是有的,如果大家理解了Redo Threads和Streams概念,也就没什么了,下面这段文字清晰了解释了两者的 ...
- PhpDocumentor 生成文档
最近项目需要phpdoc生成文档,首先安装PhpDocumentor,利用pear安装: 切换用户: su root 安装PhpDocumentor: pear install PhpDocument ...
- EvalAI使用——类似kaggle的开源平台,不过没有kernel fork功能,比较蛋疼
官方的代码 https://github.com/Cloud-CV/EvalAI 我一直没法成功import yaml配置举办比赛(create a challenge on EvalAI 使用htt ...
- hive top n
hive 中窗口函数row_number,rank,dense_ran,ntile分析函数的用法 hive中一般取top n时,row_number(),rank,dense_ran()这三个函数就派 ...
- windows7时间同步设置
1. 设置同步源 服务器修改为本车的104的ip地址,例如23车,手动输入 96.3.123.104 2. 设置同步周期. 注册表法 在“运行”框输入“Regedit”进入注册表编辑器 这种方法是通过 ...
- .net core Asp.net Mvc Ef 网站搭建 vs2017 1)
1)开发环境搭建 首先下载安装vs2017 地址 :https://www.visualstudio.com/zh-hans/downloads/ 安装勾选几项如下图 ,注意点在单个组件时.net ...
- nginx:负载均衡实战(一)
1.负载均衡说明 2.准备 我自己在电脑布置了两台虚拟机,两台都有nginx和tomcat,两台虚拟机布置的ip分别是37以及54,我在tomcat的首页动了点手脚,方便自己看是来自哪个ip的 接着在 ...