NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

stud_dict = dict()
note_dict = dict()

def readStud():
with open("studenti.txt") as file:
lines = file.readlines()
return lines


def readNote():
with open("note.txt") as file:
lines = file.readlines()
return lines


def cautareNume(numeCautat):
print("ID", "Nume student", "Note", sep='tt')
print("----------------------------------------")
for key, value in stud_dict.items():
if(value == numeCautat):
print(key, value, note_dict[key], sep='tt')


def afisareStudenti():
print("Id", "Nume student", sep='tt')
for key, value in stud_dict.items():
print(key, value, sep='tt')

def afisareNote():
print("ID stud", "Note", sep='tt')
for key, value in note_dict.items():
print(key, value, sep='tt')

def afisareStudentNote():
print("ID", "Nume student", "Note", sep='tt')
print("----------------------------------------")
for key, value in stud_dict.items():
print(key, value, note_dict[key], sep='tt')



def printStudPromovati():
print("ID", "Nume student", "Note", sep='tt')
print("----------------------------------------")
for key, value in stud_dict.items():
note = [int(i) for i in str(note_dict[key]).split(" ")]
med=calculareMedie(note)
if med >= 5:
print(key, value, "{0:.2f}".format(med), sep='tt')

def calculareMedie(note):
sumaNote = 0
for nr in note:
sumaNote = sumaNote + nr

return sumaNote / len(note)


def infoAutor():
return "Rotaru Ioan"


def menu():
print("==============Menu==================")
print("1. Incarcare informatii din fisiere")
print("2. Afisare studenti.txt")
print("3. Afisare note.txt")
print("4. Afisare studenti.txt si notele obtinute")
print("5. Cautare student dupa nume")
print("6. Afisare studenti.txt promovati")
print("7. Info autor")
print("8. Termina program")
print("===================================")
return int(input("Alegeti o optiune: "))


def main():
menubool = True
while menubool:
try:
opt = menu()
print("")
if opt == 8:
exit(0)
elif opt == 1:
for element in readStud():
els = element.split(",")
stud_dict[int(els[0])] = els[1].strip()

for element in readNote():
els = element.split(",")
note_dict[int(els[0])] = els[1].strip()
print("")
elif opt == 2:
afisareStudenti()
print("")
elif opt == 3:
afisareNote()
print("")
elif opt == 4:
afisareStudentNote()
print("")
elif opt == 5:
cautareNume(input("Introduceti nume: "))
print("")
elif opt == 6:
print("Studenti promovate")
printStudPromovati()
print("")
elif opt == 7:
print("Rotaru Ioan")
infoAutor()
print("")
else:
print("Optiune invalida")

except ValueError:
print("Optiune invalida")


if __name__ == '__main__':
main()
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.