python multiplication operator code example
Example 1: Multiplication table with Python
first_doc = '''it created by iliya zahedi abghari
i am the student in iran , alameh tabatabayi school
'''
print(first_doc)
def jadval_zarb(rows, columns):
for i in range(1,rows+1):
for j in range(1,columns+1):
print('{:>4}'.format(i* j), end=' ')
print()
jadval_zarb(10,10)
def do_continue():
choice = str(input('continue(yes/no)?')).lower()
if(choice !='yes'):
return False
return True
while True:
rows = int(input("Enter rows:"))
columns = int(input("Enter columns:"))
jadval_zarb(rows, columns)
if(not do_continue()):
break
Example 2: python math operators
2 ** 3
22 % 8
22 // 8
22 / 8
3 * 3
5 - 2
2 + 2
Example 3: python comparison operators
42 == 42
'dog' != 'cat'
45 < 42
45 > 42
40 <= 40
39 >= 40