physique.py

Created by enzo-ginhoux-07

Created on October 10, 2021

2.85 KB


def physique():
  print("masse volumique = 1")
  print("densité = 2")
  print("pourcentage massique = 3")
  print("concentration en masse = 4")
  print("dissolutuion(mere/fille) = 5")
  a = float(input("quelle formule ?"))

  if a == 1:
      b = input("unité de m = ")
      c = input ("unité de V = ")
      print("que voulez vous calculer ?")
      print("soit p, soit m soit V")
      d = str(input( ))
      if d == "p":
          m = float(input("m = "))
          V = float(input("V = "))
          p = m/V
          print("p = ",p,b,"/",c)
          physique()
      elif d == "m":
          p = float(input("p = "))
          V = float(input("V = "))
          m = p*V
          print("m = ", m,b)
          physique()
      else:
          m = float(input("m = "))
          p = float(input("p = "))
          V = m/p
          print("V = ",V, c)
          physique()


  elif a == 2:
      print("que voulez vous calculer ?")
      print("soit d ou p")
      d = str(input( ))
      if d == "d":
        p=float(input("p= "))
        d=p/1000
        print("d= ",d)
      elif d == "p":
        de=float(input("d= "))
        p=de*1000
        print("p= ",p,"g/L")


  elif a == 3:
      b=float(input("mA= "))
      c=float(input("m= "))
      d=(b/c)*100
      print("pourcentage massique = ",d,"%")
      physique()


  elif a == 4:
      print("que voulez vous calculer ?")
      print("Cm=1, m=2 et V=3")
      d=float(input( ))
      if d == 1:
          b=float(input("m = "))
          c=float(input("V = "))
          e=b/c
          print("Cm =",e,"g/L")
          physique()
      elif d == 2:
          b = float(input("Cm = "))
          c = float(input("V = "))
          e=b*c
          print("m = ",e,"g")
          physique()
      elif d == 3:
          b=float(input("m = "))
          c=float(input("Cm = "))
          e=b/c
          print("V = ", e, "L")
          physique()


  elif a == 5:
      print("que voulez vous calculer ?")
      print("tm=1, Vm=2, tf=3 et Vf=4")
      d = float(input( ))
      if d == 1:
          b=float(input("tf= "))
          c=float(input("Vf= "))
          d=float(input("Vm= "))
          e=(b*c)/d
          print("tm= ",e,"g/L")
          physique()
      elif d == 2:
          b = float(input("tf= "))
          c = float(input("Vf= "))
          d = float(input("tm= "))
          e = (b * c) / d
          print("Vm= ", e, "g/L")
          physique()
      elif d == 3:
          b = float(input("tm= "))
          c = float(input("Vm= "))
          d = float(input("Vf= "))
          e = (b * c) / d
          print("tf= ", e, "g/L")
          physique()
      elif d == 4:
          b = float(input("tm= "))
          c = float(input("Vm= "))
          d = float(input("tf= "))
          e = (b * c) / d
          print("Vf= ", e, "g/L")
          physique()
  else :
    print("mauvais chiffre")
    physique()

physique()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.