Coding Cheat Sheets
■ Python Cheat Sheet
print("Hello World")
# Variables
name = "Yahya"
age = 14
height = 5.6
is_student = True
# Operators
+ - * / // % **
# Conditions
if age > 18:
print("Adult")
elif age == 18:
print("Exactly 18")
else:
print("Minor")
# Loops
for i in range(5):
print(i)
while age < 18:
age += 1
# Lists
numbers = [1, 2, 3]
[Link](4)
[Link](2)
# Dictionary
student = {"name": "Yahya", "grade": 8}
# Functions
def greet(name):
return "Hello " + name
■ HTML Cheat Sheet
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a paragraph.</p>
<a href="[Link]
<img src="[Link]" alt="Image">
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</body>
</html>
■ Luau (Roblox) Cheat Sheet
print("Hello Roblox")
-- Variables
local name = "Player"
local score = 0
-- Function
local function greet(playerName)
return "Hello " .. playerName
end
-- If Statement
if score > 10 then
print("Winner!")
else
print("Keep trying!")
end
-- Loop
for i = 1, 5 do
print(i)
end
-- Accessing Parts
local part = [Link]
[Link] = [Link]("Bright red")