摘要:
作业一:将字符串”k:1/k1:2/k2:3/k3:4”处理成字典(比较难) 方法一 1 list = 'k:1/k1:2/k2:3/k3:4' 2 new_list = list.split("/") 3 print(new_list) 4 dic = {} 5 for i in new_list 阅读全文
posted @ 2019-07-18 15:14
wlswang
阅读(309)
评论(0)
推荐(0)
摘要:
1 def is_float(string): 2 string1 = str(string) 3 if string1.count('.') > 1: #检测字符串小数点的个数 4 return False 5 elif string1.isdigit(): #检测字符串是否只由数字组成,如果字符 阅读全文
posted @ 2019-07-18 13:53
wlswang
阅读(309)
评论(0)
推荐(0)
摘要:
1 weight = input("请输入体重:") 2 height = input("请输入身高:") 3 BMI = float(float(weight)/(float(height)**2)) 4 #计算bmi的公式 5 if BMI<= 18.5: 6 print("弱不禁风",BMI) 阅读全文
posted @ 2019-07-18 13:27
wlswang
阅读(486)
评论(0)
推荐(0)

浙公网安备 33010602011771号