July 17, 2023

basic python -12

Python Function Header In Python, a function header is the first part of a function definition. It starts with the keyword def, followed by the function name and parentheses () which may include parameters, and ends with a colon :. Example: def greet(name): print(f”Hello, {name}!”) In this example, greet is the function name and name …

basic python -12 Read More »

basic python-11

Python Operator Precedence Precedence Operator Description 1 () Parentheses 2 ** Exponentiation 3 +x, -x, ~x Unary plus, Unary minus, Bitwise NOT 4 *, /, //, % Multiplication, Division, Floor division, Modulus 5 +, – Addition, Subtraction 6 Bitwise shift operators 7 & Bitwise AND 8 ^ Bitwise XOR 9 | Bitwise OR 10 ==, …

basic python-11 Read More »

Basic python -10 (QNA)

Python Terminology Differences Terms Definitions Examples Default Arguments Values that are set in the function definition and used if no argument value is passed during the function call. def greet(name=”User”): print(f”Hello, {name}”) greet() # Outputs: Hello, User greet(“Alice”) # Outputs: Hello, Alice Keyword Arguments Arguments that are identified by their parameter name when passed during …

Basic python -10 (QNA) Read More »

Scroll to Top