Python 入门

less than 1 minute read

Python - A powerful language

1.1. A simple program

Hello, world

#!/usr/bin/env python3
print("Hello", "World")

1.2. 数据类型

int and str

1.2.1. str Usage

print(name.title())                         # 首字母大写
print(name.upper())                         # 全部大写
print(name.lower())                         # 全部小写
print(favourite_language.rstrip())          # 去处末尾空格
print(favourite_language.lstrip())          # 去处开头空格
print(favourite_language.strip())           # 去除所有空格

1.2.2. int Usage

+ - * / 运算

Leave a comment