您的位置:首页 > 编程语言 > Python开发

4.1 - Python Statements

2015-11-19 01:25 483 查看
# Assignment

a = 10
b = "python"

# Print Statement
print("Print text to output")

# If/Else
if a < 10:
print("less than")
elif a == 10:
print("equal to")
else:
print("greeater than")

#For Loop( iterate over a sequence)

for x in range(0, 10):
if x % 2:
continue  #continue execution of the loop
else:
print(x)

# While Loop
while True:
if exitloop():
break  # Exit the loop

# Function

def add(input_a, input_b):
return input_a + input_b # Return statement

# Import Module

import os
import maya.cmds as cmds
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: