【Python爬虫作业】-基础数据类型和七则运算

第一题

a=10
b=3

c1=a/b-a
print(a,"/",b,"-",a,"=",c1)
print("the type of the result is:",type(c1),"\n")

c2=a/b*a
print(a,"/",b,"*",a,"=",c2)
print("the type of the result is:",type(c2),"\n")

c3=0.1*a//b-a
print("0.1*",a,"//",b,"-",a,"=",c3)
print("the type of the result is:",type(c3),"\n")

c4=a//b+a%b
print(a,"//",b,"+",a,"%",b,"=",c4)
print("the type of the result is:",type(c4),"\n")

第二题

count_of_head = 35
count_of_foot = 94

number_of_rabbit = (count_of_foot - 2 * count_of_head) // 2
number_of_chick = count_of_head - number_of_rabbit

print("number_of_rabbit is ",number_of_rabbit,"\n")
print("number_of_chick is ",number_of_chick,"\n")
    原文作者:丽雁解
    原文地址: https://www.jianshu.com/p/fe5302cfd6f7
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞