# _*_ coding:utf-8 _*_
"""
name:zhangxingzai
date:2022/10/24
"""
# 数据类型-字符串string
print('Hello World')
# 赋值变量输出
massage = 'hello WORLD'
print(massage)
# 修改字符串的大小写
print(massage.title()) # 首字母大写
print(massage.upper()) # 全部大写
print(massage.lower()) # 全部小写
# 字符串的拼接
first_name = 'hello'
last_name = 'world'
full_name = first_name + last_name
print(full_name)
# 也可以用{}中加变量表示为变量值
full_name1 = f"{first_name} {last_name}" # f语法是python3.6引入的,之前的版本需要使用方法format(),例:{}{}.format(first_name,last_name)
print(full_name1)
# 字符串拼接&修改字符串
print(f"Python3,{full_name1.title()}!")
# 制表符与换行符
print('hello \tworld')
print('hello \nworld')
print('Languages: \n\tpython \n\tC \n\tJava')
# 删除字符串中的空白
massage1 = ' python3 '
print(massage1.rstrip()) # 去掉字符串末尾的空白
print(massage1.lstrip()) # 去掉字符串开头的空白
print(massage1.strip()) # 去掉字符串两头的空白
print(massage1)
# 数据类型-整数int + - * / ()运算
print(1 + 2)
print(3 - 2)
print(3 * 2)
print(2 / 2)
print((1 + 2) * 3)
print(2 ** 3)
# 数据类型-浮点数float
print(1 + 2.0)
print(0.22 * 0.22)
print(int(0.2 * 6))
# 数字中的下划线,给数字分组,方便阅读,不打印
money = 1_000_000_000
print(money)
# 同时给多个变量赋值
a, b, c = 1, 2, 3
# python之禅
import this
# python用#注释,多行注释是选中要注释的行ctrl + / ;取消一样