Advertisement
Guest User

Mini OS.py 1.0

a guest
Oct 22nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.56 KB | None | 0 0
  1. # Demarrage
  2. import random
  3. print("Système Opérationnel")
  4.  
  5. def start():
  6.  
  7. commande1 = str(input("[ENTREZ COMMANDE] [...] : "))
  8. print("[COMMANDE] [...] : " + str(commande1))
  9. #Ecrire
  10. if commande1 == "wrt":
  11.     string1wrt = str(input("[SRRING] : "))
  12.     print("[RESULT] : " + str(string1wrt))
  13.     print("[END]")
  14. #Calculer+
  15. if commande1 == "clc+":
  16.     a1 = int(input("[ENTREZ LA VALEUR A]"))
  17.     b1 = int(input("[ENTREZ LA VALEUR B]"))
  18.     r1 = int(a1 + b1)
  19.     print("[RESULT] : " + str(r1))
  20.     print("[END]")
  21.     # Calculer-
  22. if  commande1 == "clc-":
  23.     a2 = int(input("[ENTREZ LA VALEUR A]"))
  24.     b2 = int(input("[ENTREZ LA VALEUR B]"))
  25.     r2 = int(a2 - b2)
  26.     print("[RESULT] : " + str(r2))
  27.     print("[END]")
  28.     # Calculer*
  29. if commande1 == "clc*":
  30.     a3 = int(input("[ENTREZ LA VALEUR A]"))
  31.     b3 = int(input("[ENTREZ LA VALEUR B]"))
  32.     r3 = int(a3 * b3)
  33.     print("[RESULT] : " + str(r3))
  34.     print("[END]")
  35.     # Calculer/
  36. if commande1 == "clc/":
  37.     a4 = int(input("[ENTREZ LA VALEUR A]"))
  38.     b4 = int(input("[ENTREZ LA VALEUR B]"))
  39.     r4 = int(a4 + b4)
  40.     print("[RESULT] : " + str(r4))
  41.     print("[END]")
  42. # LenghtStr
  43. if commande1 == "len":
  44.     string1len = str(input("[ENTREZ UN STRING]"))
  45.     result1len = int(len(string1len))
  46.     print("[RESULT] : " + str(result1len))
  47.     print("[END]")
  48. #Pierre feuille papier ciseaux
  49. if commande1 == "pfpc":
  50.     playerOBJ = str(input("[ENTREZ EN MAJUSCULE L'OBJET]"))
  51.     computerOBJv = random.randint(1, 4)
  52.     print("[COMPUTER-VALUE] : " + str(computerOBJv))
  53.     computerOBJ = "R"
  54.     if computerOBJv == 1:
  55.         computerOBJ = "PIERRE"
  56.     if computerOBJv == 2:
  57.         computerOBJ = "FEUILLE"
  58.     if computerOBJv == 3:
  59.         computerOBJ = "PAPIER"
  60.     if computerOBJv == 4:
  61.         computerOBJ = "CISEAUX"
  62.     print("[PLAYER] : " + str(playerOBJ))
  63.     print("[COMPUTER] : " + str(computerOBJ))
  64.     print("[END]")
  65. if commande1 == "moy3":
  66.     note1 = int(input("Entrez la première note."))
  67.     note2 = int(input("Entrez la seconde note."))
  68.     note3 = int(input("Entrez la dernière note."))
  69.     resultatmoy = (note1 + note2 + note3) / 3
  70.     print("[MOYENNE] : " + str(resultatmoy))
  71.     print("[END]")
  72. if commande1 == "moy2":
  73.     note12 = int(input("Entrez la première note."))
  74.     note22 = int(input("Entrez la seconde note."))
  75.     resultatmoy2 = (note12 + note22) / 2
  76.     print("[MOYENNE] : " + str(resultatmoy2))
  77.     print("[END]")
  78. if commande1 == "moy4":
  79.     note13 = int(input("Entrez la première note."))
  80.     note23 = int(input("Entrez la seconde note."))
  81.     note33 = int(input("Entrez la troisième note."))
  82.     note43 = int(input("Entrez la dernière note."))
  83.     resultatmoy3 = (note13 + note23 + note33 + note43) / 4
  84.     print("[MOYENNE] : " + str(resultatmoy3))
  85.     print("[END]")
  86. if commande1 == "moy11":
  87.     note14 = int(input("Entrez la première note."))
  88.     note24 = int(input("Entrez la seconde note."))
  89.     note34 = int(input("Entrez la troisième note."))
  90.     note44 = int(input("Entrez la quatrième note."))
  91.     note54 = int(input("Entrez la cinquième note."))
  92.     note64 = int(input("Entrez la sixième note."))
  93.     note74 = int(input("Entrez la septième note."))
  94.     note84 = int(input("Entrez la huitième note."))
  95.     note94 = int(input("Entrez la neuvième note."))
  96.     note104 = int(input("Entrez la dixième note."))
  97.     note114 = int(input("Entrez la dernière note."))
  98.     resultatmoy4 = (note14 + note24 + note34 + note44 + note54 + note64 + note74 + note84 + note94 + note104 + note114) / 11
  99.     print("[MOYENNE] : " + str(resultatmoy4))
  100.     print("[END]")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement