💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] ### 声明一个变量 ~~~ name = "chengchao"; print(name); ~~~ ### 1.输出hello world ~~~ //写一个01.py的文件 print("hello world") ~~~ ~~~ //在命令行中输入 python 01.py ~~~ ### 2.输入输出 ~~~ print("hello world"); name = input("chengchao"); print(name); ~~~ ### 3.没有括号的if语法 ~~~ if True: print("true"); else: print("false"); ~~~ ### 4.多行语句 ~~~ a = 10; b = 20; c = 30; total = a+\ b+c; print(total); ~~~ 4.1 #### 在 [], {}, 或 () 中的多行语句,不需要使用反斜杠(\) ~~~ arr = [1,2, 3]; print(arr[0]); ~~~ ### 5.多个变量赋值 ~~~ a, b, c = 1, 2, "runoob" ~~~