DEV Community

Ari Wira Saputra
Ari Wira Saputra

Posted on

Days10_Show Me the $$

Code basic math principles (+, -, *, /), build your own tip calculator, and never calculate numbers again!

#Nesting Dolls Code
#
#20 MARCH 2023

def exercise_1():
  adding = 4+3
  subtraction = 8-9
  multiplication = 4*12
  division = 50/5
  squared = 5**2

  modulo = 15 % 4
  divisor = 15 // 2
  print(adding,subtraction,multiplication,division,squared,modulo,divisor)

def exercise_2():
  a = 3.4
  b = 6.8
  c = 2467
  d = 4673
  e = 10
  f = a*b
  g = c/d
  h = e^2
  print(f,g,h)


def cell():
  exercise_1()
  exercise_2()
cell()
Enter fullscreen mode Exit fullscreen mode

Top comments (0)