Skip to content
Snippets Groups Projects
Commit 45d6d308 authored by BERNHARD Delphine's avatar BERNHARD Delphine
Browse files

Ajout cours 6

parent 58ce8fa0
Branches
Tags
No related merge requests found
This diff is collapsed.
City Latitude Hemisphere
AberdeenScotland 57 N
AdelaideAustralia 34 S
AlgiersAlgeria 36 N
AmsterdamNetherlands 52 N
AnkaraTurkey 39 N
AsuncionParaguay 25 S
AthensGreece 37 N
AucklandNewZealand 36 S
BangkokThailand 13 N
BarcelonaSpain 41 N
BeijingChina 39 N
BelemBrazil 1 S
BelfastNorthernIreland 54 N
BelgradeSerbia 44 N
BerlinGermany 52 N
BirminghamEngland 52 N
BogotaColombia 1 N
BombayIndia 19 N
BordeauxFrance 44 N
BremenGermany 53 N
BrisbaneAustralia 27 S
BristolEngland 51 N
BrusselsBelgium 50 N
BucharestRomania 44 N
BudapestHungary 47 N
BuenosAiresArgentina 34 S
CairoEgypt 30 N
CalcuttaIndia 22 N
CantonChina 23 N
CapeTownSouthAfrica 33 S
CaracasVenezuela 10 N
CayenneFrenchGuiana 1 N
ChihuahuaMexico 28 N
ChongqingChina 29 N
CopenhagenDenmark 55 N
CordobaArgentina 31 S
DakarSenegal 14 N
DarwinAustralia 12 S
DjiboutiDjibouti 11 N
DublinIreland 53 N
DurbanSouthAfrica 29 S
EdinburghScotland 55 N
FrankfurtGermany 50 N
GeorgetownGuyana 1 N
GlasgowScotland 55 N
GuatemalaCityGuatemala 14 N
GuayaquilEcuador 1 S
HamburgGermany 53 N
HammerfestNorway 70 N
HavanaCuba 23 N
HelsinkiFinland 60 N
HobartTasmania 42 S
HongKongChina 22 N
IquiqueChile 20 S
IrkutskRussia 52 N
JakartaIndonesia 1 S
JohannesburgSouthAfrica 26 S
KingstonJamaica 17 N
KinshasaCongo 1 S
KualaLumpurMalaysia 1 N
LaPazBolivia 16 S
LeedsEngland 53 N
LimaPeru 12 S
LisbonPortugal 38 N
LiverpoolEngland 53 N
LondonEngland 51 N
LyonsFrance 45 N
MadridSpain 40 N
ManchesterEngland 53 N
ManilaPhilippines 14 N
MarseillesFrance 43 N
MazatlánMexico 23 N
MeccaSaudiArabia 21 N
MelbourneAustralia 37 S
MexicoCityMexico 19 N
MilanItaly 45 N
MontevideoUruguay 34 S
MoscowRussia 55 N
MunichGermany 48 N
NagasakiJapan 32 N
NagoyaJapan 35 N
NairobiKenya 1 S
NanjingChina 32 N
NaplesItaly 40 N
NewDelhiIndia 28 N
NewcastleonTyneEngland 54 N
OdessaUkraine 46 N
OsakaJapan 34 N
OsloNorway 59 N
PanamaCityPanama 1 N
ParamariboSuriname 1 N
ParisFrance 48 N
PerthAustralia 31 S
PlymouthEngland 50 N
PortMoresbyPapuaNewGuinea 1 S
PragueCzechRepublic 50 N
RangoonMyanmar 16 N
ReykjavikIceland 64 N
RiodeJaneiroBrazil 22 S
RomeItaly 41 N
SalvadorBrazil 12 S
SantiagoChile 33 S
StPetersburgRussia 59 N
SaoPauloBrazil 23 S
ShanghaiChina 31 N
SingaporeSingapore 1 N
SofiaBulgaria 42 N
StockholmSweden 59 N
SydneyAustralia 34 S
TananariveMadagascar 18 S
TeheranIran 35 N
TokyoJapan 35 N
TripoliLibya 32 N
VeniceItaly 45 N
VeracruzMexico 19 N
ViennaAustria 48 N
VladivostokRussia 43 N
WarsawPoland 52 N
WellingtonNewZealand 41 S
ZurichSwitzerland 47 N
\ No newline at end of file
Bonjour
Nous sommes en octobre
Bonne journée
\ No newline at end of file
ligne1
ligne2
ligne3
ligne4
12
23
-10
56
-45
3
125
\ No newline at end of file
? Quelle est la bonne manière de définir une chaîne de caractères contenant le mot "Bonjour" ?
[A] "Bonjour" = s
[B] s = Bonjour
[C] s = "Bonjour"
* C
? Par quel(s) caractère(s) commencent les lignes de commentaire ?
[A] //
[B] %
[C] #
[D] $
* C
? Que va afficher le code ci-dessous ?
? nom = "Myrtille"
? print(len(nom))
[A] nom
[B] 10
[C] Myrtille
[D] 8
* D
? Comment déclarer correctement la chaîne suivante ? Pierre dit : "J'ai fait un gâteau"
[A] s = "Pierre dit : "J'ai fait un gâteau""
[B] s = 'Pierre dit : "J'ai fait un gâteau"'
[C] s = 'Pierre dit : "J\'ai fait un gâteau"'
[D] s = Pierre dit : "J'ai fait un gâteau"
* C
? Que va afficher le code ci-dessous ?
? mot = "programme"
? print(mot[3]+mot[2]+mot[6:]+mot[1])
[A] ramper
[B] gramme
[C] gommer
[D] gommera
* C
? Lequel parmi les codes suivants ouvre le fichier roman.txt en mode écriture et permet d'obtenir un objet de type fichier appelé f ?
[A] with open("roman.txt", "w") as f :
[B] with open("roman.txt", "e") as f :
[C] with open("roman.txt", "r") as f :
* A
? Remplissez les blancs dans le code ci-dessous : le code devrait écrire deux lignes dans le fichier agenda.txt
? with open("agenda.txt", "w") __ ____ :
? fich.write("11/10/2018 Cours\n")
? fich.write("12/10/2018 Sport")
[A] Il n'y a rien à mettre dans les blancs
[B] fich
[C] as f
[D] as fich
* D
? A quoi sert une boucle ?
[A] Lire un fichier
[B] Répéter automatiquement des instructions
[C] Revenir au début du programme
[D] Tester une condition
* B
? Quel caractère spécial correspond au retour à la ligne ?
[A] /n
[B] |n
[C] \t
[D] \n
* D
? Que va afficher le code ci-dessous ?
? nombres = [5, 8, 3, 4, 10]
? print(nombres[-2] + nombres[3])
[A] 8
[B] 1
[C] 12
[D] 7
* A
? Soit la liste suivant : fruits = ["pomme", "poire", "banane"]. Comment ajouter "orange" en fin de liste, après "banane" ?
[A] fruits[3] = "orange"
[B] fruits.append("orange")
[C] fruits[-1] = "orange"
[D] fruits + "orange"
* B
? Quelle va être la valeur de legumes après avoir exécuté le code ci-contre ?
? legumes = ["poireau", "chou", "carotte", "navet", "potiron"]
? legumes.remove("navet")
[A] ["poireau", "chou", "carotte", "potiron"]
[B] 5
[C] ["poireau", "chou", "carotte", "navet", "potiron"]
[D] 4
* A
? liste[a:b] va retourner la portion de liste qui commence à l'indice a et se termine avant l'indice b
[A] Vrai
[B] Faux
* A
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment