36
loading...
This website collects cookies to deliver better user experience
print("Hello World!")
# Output
# Hello World!
# Addition
5 + 5
# Subtraction
10 - 5
# Multiplication
3 * 2
# Division
20 / 4
# Output
# 10
# 5
# 6
# 5.0
# Here a and b are variables.
a = 2
b = 5
print(a + b)
# Output
# 7
False def if raise
None del import return
True elif in try
and else is while
as except lambda with
assert finally nonlocal yield
break for not
class from or
continue global pass
a = 2
b = 8
sum = a + b
print(sum)
# Here 2, 3 are values.
# Print(sum) is a statement
# sum = a + b is an expression.
# The interpreter will first evaluate a + b and then it will give the value
print("This is a comment.") # This is a comment.
# Output
# This is a comment.
# You can write multi line
# comments in this way.
'''
Or if you don't like using hash(#)
You can use triple quotes also
To write multi line comments
'''
def check_password(password):
if password == "Helloworld"
print("password is correct!")
else:
print("Wrong password")