-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathguide_erreur.py
More file actions
101 lines (64 loc) · 1.09 KB
/
Copy pathguide_erreur.py
File metadata and controls
101 lines (64 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
##############################
# Guide - Erreurs classiques
##############################
#######################
# Erreur d'indentation
# a = 3
# b = 2
#######################
# Erreur de syntaxe
# while x >= 0
# x = x - 1
# chaine = Coucou
# print("Coucou"
# val = 0
# if val = 1:
# print("ok")
#######################
# Erreur de type
# n = 7.0
# for i in range(n):
# print(i)
# from math import *
# x = "9"
# sqrt(x)
#######################
# Erreur de nom
# x = sqrt(2)
# if y != 0:
# y = y - 1
# from math import *
# gcd(12)
# produit(6,7)
# def produit(a,b):
# return a*b
#######################
# Boucle et liste
for i in range(10):
print(i ** 2)
# liste = [1,2,3,4]
# print(liste[4])
n = 0
while n != "10":
n = n + 1
print(n)
#######################
# Exercice
#######################
a = 7
if (a == 2) or (a >= 5) :
b = a - 2
c = a + 2
else:
b = a // 2
c = 2 * a
print(a,b,c)
#######################
# a == 7
# if (a = 2) or (a >= 5)
# b = a - 2
# c = a + 2
# else
# b = a // 2
# c = 2 * a
# print(a b c)