Année scolaire : 2021 / 2022
Lycée HATEM
MEKKI Date : FEV/2022 Durée : 1 h Coéf. : 1 Classe : 2ème Sc
Note :
INFORMATIQUE Prof. : Mr. MEKKI Anis
TEST D’EVALUATION N°2 20
Nom & prénom :……………………………………………N° :………….
(Q.C.M : Questions à Choix Multiples)
Cocher la bonne réponse.
X=-3
x = int(input("x= "))
Le programme affiche :
if x<0 :
A=-x
|3| =-3
print( "|" + str(x)+ "| =" + str(A))
|-3| =-3
|-3| =3
1er mot: Tunis
mot1= input("1er mot:")
mot2= input("2ème mot : ") 2ème mot :Tunisie
if (len(mot1) < len(mot2) ): Le programme affiche :
print (mot1)
else: Tunis
print (mot2) mot1
Tunisie
x=int(input("donner un nombre ")) X=65
ch=chr(x) Le programme affiche :
print(ch)
A
65
ch
x=int(input(" donner x ")) X= 15
Le programme affiche :
if (x %2 == 0) :
msg="paire" paire
else :
msg="impaire"
nul
print(msg) impaire
1
x = int(input("x= ")) X=33
if( x%3==0): Le programme affiche :
print(x, "divisible par 3")
else : 33 non divisible par 3
print(x, "non divisible par 3") 33 divisible par 3
erreur
x = int(input("x= ")) X=3 et y= 5
y= int (input("y= ")) Le programme affiche :
if(x>y) and (x%y==1)):
x=x+3 x=6 y=4
y=y-1
else:
x=0 y=9
x=x-3 x=3 y=5
y=y+4
print(‘x=’,x,’y=’,y)
Ch=input("donner une chaine de 4 caractère ")) Ch= ‘RAAR’
if(ch[0]==ch[3] and ch[1]==ch[2]): Le programme affiche :
print(ch, "est palindrome")
else : ‘’est palindrome’’
print(ch, "est non palindrome") ’’RAAR est palindrome’’
’’RAAR est non palindrome’’
ch1= "devoir" Le programme affiche :
ch2= "sciences"
if (ch1[2]!=ch2[2]) : devoir SCIENCES
ch1=[Link]() devoir sciences
else :
ch2=[Link]() DEVOIR sciences
print(ch1,’ ‘,ch2)
x=3 13 2
y=7
if((x<y)and not(y!=7)):
13 7
print(x+10,y-5) -2 7
else :
print(x-5,y)
ch="mahres3060" mahres3060
if (len(ch) % 2 == 0) :
3060
msg=ch[0:6] mahres
else :
msg=ch[6:]
print(msg)
2
3