mirror of
https://github.com/arthur-pbty/nsi.git
synced 2026-06-04 15:56:20 +02:00
Add exercises 1, 2 and 3
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
fichier = 536
|
||||
print("Fichier :", fichier, "kio", fichier * 2**10, "octets",fichier * 8 * 2**10, "bits")
|
||||
@@ -0,0 +1,5 @@
|
||||
cle = 1891126108268
|
||||
|
||||
res = 97 - cle%97
|
||||
|
||||
print("La clé de contrçôle de", cle, "est", res)
|
||||
@@ -0,0 +1,5 @@
|
||||
from math import *
|
||||
a = sqrt(4.6**3 - 15/16)
|
||||
print(a)
|
||||
if a == 9.818273779030608:
|
||||
print("C'est bien égale")
|
||||
@@ -0,0 +1,4 @@
|
||||
prenom = "Léa"
|
||||
nom = "Martin"
|
||||
|
||||
print(prenom[0], nom[0])
|
||||
@@ -0,0 +1,4 @@
|
||||
prenom = "Alexandre"
|
||||
nom = "Lecouturier"
|
||||
|
||||
print(prenom, nom, "a pour identifiant ",prenom[0:3].lower() + "." + nom.lower())
|
||||
@@ -0,0 +1,12 @@
|
||||
identifiants = {
|
||||
"ale.lecouturier":"Huz4",
|
||||
"lea.martin":"monty"
|
||||
}
|
||||
|
||||
identifiant = input("Identifiant : ")
|
||||
motdepasse = input("Mot de passe : ")
|
||||
|
||||
if identifiant in identifiants and motdepasse == identifiants[identifiant]:
|
||||
print(True)
|
||||
else:
|
||||
print(False)
|
||||
@@ -0,0 +1,39 @@
|
||||
identifiants = {
|
||||
"ale.lecouturier":"Huz4",
|
||||
"lea.martin":"monty"
|
||||
}
|
||||
|
||||
#identifiant = input("Identifiant : ")
|
||||
#motdepasse = input("Mot de passe : ")
|
||||
|
||||
def f():
|
||||
if identifiant.get() in identifiants and motdepasse.get() == identifiants[identifiant]:
|
||||
print(True)
|
||||
else:
|
||||
print(False)
|
||||
|
||||
|
||||
from tkinter import *
|
||||
|
||||
fenetre = Tk()
|
||||
|
||||
label = Label(fenetre, text="Identifiant :")
|
||||
label.pack()
|
||||
|
||||
|
||||
identifiant = Entry(fenetre, width=30)
|
||||
identifiant.pack()
|
||||
|
||||
|
||||
|
||||
label = Label(fenetre, text="Mot de passe :")
|
||||
label.pack()
|
||||
|
||||
|
||||
motdepasse = Entry(fenetre, width=30)
|
||||
motdepasse.pack()
|
||||
|
||||
bouton = Button(fenetre, text="Se connecter", command=f)
|
||||
bouton.pack()
|
||||
|
||||
fenetre.mainloop()
|
||||
Reference in New Issue
Block a user