In Python, the expression int(hexNum, 16) means “convert a hexadecimal string into a decimal integer.”
Curly brackets: dictionaries
In Python, def is the keyword used to define a function.
In Python, a for loop is used to repeat a block of code for each item in a sequence (like a list, tuple, string, or range).
for variable in sequence:
# code block
variable → takes each value from the sequence one by one.
sequence → the collection you want to loop through.
The code block runs once for each item.
In Python, char isn’t a separate data type like in some other languages (for example, C or Java).
def check_number(n):
if n > 0:
return "Positive"
elif n == 0:
return "Zero"
else:
return "Negative"
print(check_number(5)) # Positive
print(check_number(0)) # Zero
print(check_number(-3)) # Negative
== is the equality operator. It’s used to check whether two values are equal.