1、字符串 - 单双引号,三引号
2、取值:取指定位置
索引/下标
正向索引
逆向索引
3、切片
print(str_py[::-1])
str_element = ''
print(type(str_element))
print(str_py[0])
print(str_py[100])
lenght = len(str_py)
print(lebght)
print(str_py[40])
print(str_py[lenght-1]) = print(str_py[40])
print(str_py[-1])
取 hello 0,1,2,3,4
print(str_python[0:5])
print(str_python[5])
print(str_python[::])
print(str_python[::1])
print(str_python[::-1])
print(str_py[-2:-8:-2])
print(str_py[2:8:2])
srt_py1 = 'Hello,Python!!'
new_str = str_py1.lower()
new_str1 = str_py1.upper()
print(new_str)
print(new_str1)
res = str_py1.find("37")
print(res)
res = str_py1.find("ell")
print(res)
str_2 = "hello python,hello,lesson!!!"
new_str =str_2.replace('hello','666')
print(new_str)
new_str =str_2.replace('hello','666',1)
print(new_str)
new_str = str_2.replace("hello", 666,1)
print(new_str)
new_str = str_2.replace("lesson", "哎呀,妈呀",1)
print(new_str)
==(等于);!=(不等于);>(大于);<(小于) >=(大于或等于) <= (小于或等于)
比较结果为:布尔值
salary1 = 1000
salary1 = 800
print(salary1 == salary2)
print(salary1 != salary2)
结果值:布尔值()bool True;False
print(salary1 > salary2)
print(salary1 < salary2)
print(salary1 >= salary2)
print(salary1 <= salary2)
print(100 * 2 == 200)
print("hello" == "world")
num1 = 60
num2 = 150
print(num1 + num2)
print(num1 - num2)
print(num1 * num2)
print(num1 / num2)
print(num1 % num2)
salary = 10000
salary += 10000
salary = salary + 10000
print(salary)
salary -= 5000
print(salary)
and(与) or(huo)not(非)
逻辑运算的结值:布尔值(bool)
左边的条件与右边对比 结果:True或者False
and 两者为真,真
or 两者为为假 假
not 取反
薪资 15000 与/或/非 福利:双休
True True
条件 与/或/ 条件
非 条件
"""
salary = input("请输入你的目标薪资: ")
print(salary)
addition = input("请输入是否双休:双休,单休,大小周")
res = (int(salary) == 18000) or not (addition == "双休")
print(res)