


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Example: coordinates = (3, 7) (toa do) Tuples: Suitable when you want to ensure that the data remains constant and cannot be accidentally modified. Often used for representing fixed sets of values.
Addition (+): Adds two operands. Subtraction (-): Subtracts the right operand from the left operand. Multiplication (): Multiplies two operands. Division (/): Divides the left operand by the right operand (always returns a float). Modulus (%): Returns the remainder of the division of the left operand by the right operand. (tìm số dư của phép chia) Exponentiation (*)(lũy thừa): Raises the left operand to the power of the right operand.
age = 20 if age < 18 : print("You are a minor.") elif 18 <= age < 21 : print("You are an adult, but not yet allowed to drink.") else: print("You are a legal adult.")
The code above contains a simple Python function called greet(). When 'called' or 'invoked', this function prints "Hello, World!" to the console.