Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #1.1.1
  2.  
  3. a=input("Quel est votre âge ?")
  4. a=int(a)
  5. if a>= 18:
  6. print ("ADULTE")
  7.  
  8. #1.1.2
  9.  
  10. a=input("Quel est votre âge ?")
  11. a=int(a)
  12. if a>= 18:
  13. print ("ADULTE")
  14. else:
  15. print ("ENFANT")
  16.  
  17. #1.1.3
  18.  
  19. a=input("Quel est votre âge ?")
  20. a=int(a)
  21. if a>= 18:
  22. print ("ADULTE")
  23. elif a<18 and a>12:
  24. print ("ADO")
  25. else:
  26. print ("ENFANT")
  27.  
  28. #1.1.4
  29.  
  30. a=input("Quel est votre âge ?")
  31. a=int(a)
  32. if a>= 18:
  33. print ("ADULTE")
  34. elif a<18 and a>12:
  35. print ("")
  36. else:
  37. print ("ENFANT")
  38.  
  39. #1.1.5
  40.  
  41. a=input("Quel est votre âge ?")
  42. a=int(a)
  43. if a>= 18:
  44. print ("")
  45. elif a<18 and a>12:
  46. print ("ADO")
  47. else:
  48. print ("")
  49.  
  50. #1.1.6
  51.  
  52. a=input("Quel est votre âge ?")
  53. a=int(a)
  54. if a>= 18 and a<=150 :
  55. print ("")
  56. elif a<18 and a>12:
  57. print ("ADO")
  58. elif a<=0 or a>150:
  59. print ("INHUMAIN")
  60. else:
  61. print ("")
  62.  
  63. #1.1.7
  64.  
  65. tab = [1, 7, 15, 2, 78, 9, 40]
  66. y=5
  67. compter=len(tab)
  68. if compter<=10:
  69. tab.append(y)
  70. print (tab)
  71.  
  72. #1.1.8
  73.  
  74. dico={'prénom':'Michel',
  75. 'genre':'homme',
  76. 'poids':'kilogrammes'}
  77. dico.update({'age':'20'})
  78.  
  79. #1.1.9
  80.  
  81. b=input ('Nombre')
  82. b=int(b)
  83. if b%2==0:
  84. print ('nombre pair')
  85. else:
  86. print ('nombre impair')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement