摘要:
"""练习判断一个小数1、判断是否合法2、合法需要有一个小数点3、小数点左边必须是个整数,右边必须是个正整数"""def xiaoshu(s): xiaoshu_new=str(s) if xiaoshu_new.count(".") ==1: left,right = xiaoshu_new.sp 阅读全文
摘要:
1、字典转换为字符串(json.dumps) jsongeshi={"name":"yajuan","age":"10"}import jsonwith(open("b","w",encoding="utf-8"))as f: json_new=json.dumps(jsongeshi) #字典转换 阅读全文