没有合适的资源?快使用搜索试试~ 我知道了~
Python3程序设计课后习题参考答案.pdf.pdf

温馨提示


试读
26页
Python 3 程序设计课后习题答案 译作者: 唐永华 刘德山 李玲 出版社:人民邮电出版社
资源推荐
资源详情
资源评论



















C C C C D B C
1 Python
Python .py Python .py
.pyc Python (PVM)
2 IDLE 5
Ctrl + [
Ctrl + ]
Alt+3
Alt+4
Alt+/
Alt+P
Alt+N
F1
Python
F5
Ctrl+F6
Shell
3
(Interpreter)
4 IPO
IPO (Input) (Process) (Output)3

1 1-3
# ex0101.py
# s
import math
a=eval(input(" "))
h=eval(input(" "))
s = a*h/2
print(" {:.2f}".format(s))
2 1-6
# ex0102.py
lst=['hi',"program",'school','for','''chinese''']
lst1=[]
for item in lst:
lst1.append(len(item))
p=max(lst1)
for item in lst:
if len(item)==p:
print(item,end=" ")
3
D D D D D A C A
1 Python
● Python _
●
●
●
2
( OB Ob ) ( 0o 0O ) ( Ox
OX )
bin(),hex(),oct()
3 Python
Number Python
4

1
x=eval(input(" A "))
y=eval(input(" B "))
z=eval(input(" C "))
print("3 {} {}".format((x+y+z)/3,x+y+z))
2
# s
import math
a=eval(input(" a "))
b=eval(input(" b "))
c=eval(input(" c "))
p = (a + b + c) / 2
s = math.sqrt(p * (p - a) * (p - b) * (p - c))
print(" {:.2f}".format(s))
B A B B
1 3
Python (
)
2 format()
str.format() str {}
format() str format() 3
{}
{}
format()
format()
3
split(sep, num) sep num num
join(seq) seq ( )

1
sentence='''resident Xi Jinping urged all-out efforts
to achieve the goal of eliminating poverty in China within two
years in his three-day inspection tour of Chongqing, which ended on Wednesday.
'''
sentence=sentence.replace(","," ")
sentence=sentence.replace("."," ")
words=sentence.split()
print(len(words))
2 E
sentence='''residEnt Xi Jinping urgEd all-out Efforts'''
print(sentence.replace("E"," "))
3 18 2001 09 12
xx=input("IDCard Number:")
print(xx[6:10]+" "+xx[10:12]+' '+xx[12:14]+" ")
D A A D A D B D
1 pass
pass pass
2 break continue
break
continue
continue
3 for while
for
range()
3.
1 s c c
c c
s="abc32TT9ac"
t=""
for i in range(len(s)):
if s[i].islower():
t+=s[i].upper()

elif s[i].isupper():
t+=s[i].lower()
else:
t+=s[i]
print(t)
2
num=eval(input(" "))
s=str(num)
print(s[::-1])
3 1
2
-2
2
+3
2
-4
2
+ +97
2
-98
2
+99
2
s=0
flag=1
for i in range(1,100):
s=s+i*i*flag
flag*=-1
print(s)
4 6 1 2 3,
6=1+2+3 6 100
for num in range(1,100):
t=0
s=""
for i in range(1,num//2+1):
if num%i==0:
t+=i
s+=str(i)+" "
if t==num:
print("{} {}".format(t,s))
5 m n
m=eval(input(" m:"))
n=eval(input(" n:"))
if m<n:m,n=n,m
t=m*n
r=m%n
while r!=0:
m=n
n=r
r=m%n
print(" {}".format(n))
print(" {}".format(int(t/n)))
B A D C D C D C D D
剩余25页未读,继续阅读
资源评论

- 林书尼2023-07-29通过阅读这份PDF文件,可以更好地理解Python3程序设计的概念和技巧,是一个值得推荐的学习资源。
- 仙夜子2023-07-29这个文件为Python3程序设计的学习者提供了一种非常便捷的方式来检查和巩固自己的编程知识。
- 余青葭2023-07-29这份课后习题参考答案是一个非常实用的学习工具,它以清晰、简洁的方式解答了各种Python3编程问题。
- 型爷2023-07-29这本PDF文件包含了丰富的Python3程序设计课后习题参考答案,对于提升编程能力有着很大的帮助。
- 普通网友2023-07-29这个文件提供了Python3程序设计课后习题的参考答案,对于学习者来说是一份非常实用的资料。

ksfdh_1
- 粉丝: 53
- 资源: 16
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- minsu-manager汽车租赁系统springboot+vue前台后台后端.zip
- ME2323D-VB一款P沟道SOT23封装MOSFET应用分析
- 反诈文章word版下载地址
- .arch防火道矢量数据156条.shp
- D-PDU中15765等协议标准通讯参数讲解 对于D-PDU API的实现至关重要 对于通讯任务收发的问题分析也很重要
- .arch防火道矢量数据156条.dbf
- NCE0103M-VB一款N沟道SOT89-3封装MOSFET应用分析
- 深圳SHZ苹果项目BIM图纸 Navisworks文件
- IRF530S-VB一款N沟道TO263封装MOSFET应用分析
- FDN336P-NL-VB一款P沟道SOT23封装MOSFET应用分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
