| Variables and output |
=, print(...), input(...) |
name = input("Name: ")
print("Hello", name) |
| Selection |
if, elif, else |
if score >= 10:
print("Win") |
| Loops |
for, while |
for i in range(5):
print(i) |
| Functions |
def ..., return |
def area(w, h):
return w * h |
| Pygame window |
import pygame |
pygame.display.set_mode((640, 480)) A popup game window opens when you run the code. |