* and ** in python code example

Example 1: ** in python

#** is the exponent symbol in Python, so:
print(2 ** 3)
#output: 8

Example 2: * in python

>>> fruits = ['lemon', 'pear', 'watermelon', 'tomato']
>>> print(fruits[0], fruits[1], fruits[2], fruits[3])
lemon pear watermelon tomato
>>> print(*fruits)
lemon pear watermelon tomato

Example 3: ** in python

# ** means modulus. or exponent
x = 6
y = 2
print(x**y) # will print 6 raised to power 2

Example 4: how to use asterisk in python

quotient = 3 * 4
print(quotient)  #Answer=12