Python中的输入输出函数
//输入函数
input() //可以直接用,也可以加入你想输出的东西
x = input("How old are you?")
//输出函数
print('xxxx') or print("xxxxx")
//当输出多个变量时候
print(f'{first_verify}xxx{second_verify}')
python自带的字符串函数
string.len()//字符串的长度
string.upper()//字符串全部转换成大写
string.lower()//字符串全部转换成小写
string.replace()//更换字符串中的...
string.replace('xxx','yyy')
'xxx' in string //这个返回一个布尔值,判断xxx是否在该字符串里面
...
...//可以输入好几行的字符串
string.find()//找见字符或者字符串的其实我字符的索引
Python中的运算符号
// An highlighted block
10 + 3 // 13
10 - 3 // 7
10 / 3 //3.333333
10 // 3 //3
10 ** 3 //10^3
x -= 10//x = x-10
Python中的强制类型转化
· int(x) 将x转换为一个整数
· float(x) 将x转换到一个浮点数
· str(x) 将对象 x 转换为字符串
· tuple(s) 将序列 s 转换为一个元组
· list(s) 将序列 s 转换为一个列表
· set(s) 将序列 s 转换为一个集合
Python中的常见数学函数
round()//?
abs(x) //取绝对值
import math //导入数学模块
函数库参考资料:
https://www.cnblogs.com/liuhui0308/p/12423167.html#autoid-0-0-0
Python中 的语句
if ----:
print()//快捷键shift + Tab
elif ----:
print()
else:
print()