str
: String, textint
: Number without decimal pointfloat
: Decimal number, decial point are allowedbool
: True or False
print()
: Prints the given objectstr()
: Returns the string version of the given objecttype()
: Returns the type of the object
door_open = True
print(type(door_open))
leaves_of_grass = """
I am a long text on
multiple lines
"""
name = input('Enter your name')
Relational operators compare two items and return either True or False.
==
: Equals!=
: Not equals>
: Greater than>=
: Greater than or equal to<
: Less than<=
: Less than or equal to
and
: Returns True if both sides are returns Trueor
: Returns True if one or both side are returns Truenot
: Returns True if the expression is False
user_name = "Markus"
if user_name == "Markus":
print("Hi Markus!")
if weekday:
print("wake up at 6:30")
else:
print("sleep in")
donation = 150
if donation >= 200:
print("gold donor status")
elif donation >= 100:
print("silver donor status")
else:
print("bronze donor status")