摘要:
name="陈鸿博"if "陈" in name: print("yes")else: print("no!") name="陈鸿博"if "陈" not in name: print("yes")else: print("no!") in/not in 判断在不在里面Ctrl+? 统一作注释数字字
阅读全文
posted @ 2020-04-17 09:57
质料
阅读(83)
推荐(0)
摘要:
Python2中文出现乱码是因为内部采用的是utf8编码 而微软采用的是gbk python3统一采用unicode 同时input输入的是字符串类型 new_inp=int(inp)输入1(数字)而不是字符串 inp=input("please input a number!")new_inp=i
阅读全文
posted @ 2020-04-16 12:49
质料
阅读(93)
推荐(0)
摘要:
输出1 2 3 4 5 6 8 9 count=1 while count<11: if count==7: pass else: print(count) count=count+1 输出1+....+100=的结果 count=1ad=0while count<101: count=count+
阅读全文
posted @ 2020-04-14 20:46
质料
阅读(108)
推荐(0)
摘要:
a=input("please input a number")if a==1: passelif a==2: print("good job")else: print("bye!")print("over!") 顺次执行 没有pass 记住是双等 基本数据类型 字符串 引号引起来: “这样” ;
阅读全文
posted @ 2020-04-14 17:41
质料
阅读(110)
推荐(0)
摘要:
python2与python3的不同: Python2不支持中文 除非使用转码 Python3可以使用中文 变量:字母、数字、下划线组成,且不能用数字开头,不能使用Python的关键字,最好不要使用Python内置的东西重复(sum等)。 最好让变量名更有意义使用下划线作为连接(user_id)
阅读全文
posted @ 2020-04-10 19:29
质料
阅读(121)
推荐(0)
摘要:
2020.4.1 高级语言--PHP Python Java--字节码 低级语言--C 汇编 --机器码 PHP 局限性 只能写网页 Python java 既可以写网页 也可以写后台 Python 执行效率低于Java 但开发效率高 Python
阅读全文
posted @ 2020-04-01 10:28
质料
阅读(50)
推荐(0)