If statement concept works on Boolean true and false. If block codes will execute if the Boolean expression evaluates to TRUE. If the Boolean expression evaluates to FALSE then the code inside the block will not execute.
if expression: code(...)
Python example if the statement is a true
Simple example code. Try it at least twice, with different inputs. You will get an extra output result, depending on the input.
weight = int(input("Enter suitcase weigh: ")) if weight >= 50: print("There is a $25 charge for luggage that heavy.")
Note: IDE: PyCharm 2021.3.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.