Python & SQL BibleChapter 221
Basic Python Syntax
Section 1 of 6-~ 12 min read-Synced from Cuantum content
- Print Function
print("Hello, World!")- Variable Assignment
x = 5y = "Hello, World!"- Comments
# This is a single line comment"""This is amulti-line comment"""- Conditional Statements
if x > y: print("x is greater than y")elif x < y: print("x is less than y")else: print("x is equal to y")- Loops
for i in range(5): print(i) while x < 10: print(x) x += 1- Functions
def my_function(): print("Hello from a function")