Académique Documents
Professionnel Documents
Culture Documents
1.1 Types:
1.1.1 Nombres entiers et nombres réels
[1]: a = 10
[2]: int
[3]: b=2.0
[4]: type(b)
[4]: float
[5]: type(a - b)
[5]: float
2.0 ==> 2
[6]: int
[7]: float(a)
[7]: 10.0
1
1.1.2 Booléens
[8]: v = True
f = False
[14]: g = False
[16]: type(v)
[16]: bool
[17]: v and f
[17]: False
[18]: f and g
[18]: False
[19]: v or f
[19]: True
[20]: g or f
[20]: False
[21]: True
[22]: a == 6
[22]: False
[23]: a < 6
[23]: False
[24]: a >= 6
[24]: True
[25]: True
2
1.1.3 Chaines de caractères
[ ]: "salut"
[28]: str
[29]: b=2.0
[30]: 6
[31]: '10'
102.0
10 2.0
[33]: k = 'Salam'
m = '@licom'
print(k+m)
Salam@licom
������ �����
[35]: 102.0
[36]: 112.0
[37]: 'u'
3
[ ]: deux_mots = un_mot + ' toi!'
deux_mots
[ ]: len(deux_mots)
[ ]: deux_mots[0:len(un_mot)] == un_mot
[ ]: c=19
d='COVID '
print(d+str(c))
[ ]: