top of page
Topic
Recent Posts
Archive
Tags
Compact while()
while True means loop forever. The while statement takes an expression and executes the loop body while the expression evaluates to...
int()
The int() function converts the specified value into an integer number. The int() function returns an integer object constructed from a...
float() and round()
The float() method is used to return a floating point number from a number or a string. Syntax: float(x) The method only accepts one...
if-elif-else instructions
Scenario Spathiphyllum, more commonly known as a peace lily or white sail plant, is one of the most popular indoor houseplants that...
Time evaluation
Prepare a simple code able to evaluate the end time of a period of time, given as a number of minutes (it could be arbitrarily large)....
end=, sep=, +, *, and /
Python’s print() function comes with a parameter called ‘end’. By default, the value of this parameter is ‘\n’, i.e. the new line...
Assignment (Shortcut) operators
If variable = variable op expression then variable op= expression i += 2 * j => i = i+2*j var /= 2 => var = var /2 rem %= 10 => rem =...
Binary <==> Decimal Conversion
Binary to Decimal Conversion of numbers uses weighted columns to identify the order of the digits to determine the final value of the...
bottom of page