Please enable JavaScript.
Coggle requires JavaScript to display documents.
python - Coggle Diagram
python
import turtle
turtle.pu/pd
turtle.mode('logo')
turtle.speed(0)
方向和角度
turtle.forward(...)
turtle.right/left(...)
turtle.dot/circle()
turtle.pensize(...)
turtle.done()
颜色
turtle.colormode(255)
turtle.pencolor('...')
turtle.bgcolor(0,0,0)
类型转换
str()
int()
float()
ord()
chr()
数学
+,-,*,/
%(取余)
=,==
变量**3(变量的三次方)
!=
输入输出
变量=imput()
print('...')
print(变量)
循环
for 循环
for i in range(数字/变量):
for i in 变量/数字:
while 循环
while True:
while 变量/数字==变量/数字:
import pygame
图像
pygame.init()
screen = pygame.display.set_mode((800,600))
pygame.image.load()
screen.blit(house,(... , ...))
screen.fill((0,0,0))
clock = pygame.time.Clock()
clock.tick(...)
pygame.display.update()
pygame.transform.smoothscale(图片, (宽, ⾼高))
ygame.image.load('')
screen.blit(图片,(0,0))
音频
pygame.mixer.init()
pygame.mixer.Sound('')
keys = pygame.key.get_pressed()
event.type == KEYDOWN and event.key == K_...
for event in pygame.event.get(): if event.type == QUIT: pygame.quit()
变量.play()
列表
变量名=[数字/NA]
变量.append()
or
and
注释
''' '''
' ## '
import random
random.randint(数字,数字)
if 变量/数字==变量/数字:
elif 变量/数字==变量/数字: