Hello Guys!
Can anybody help me with this code? So what I need?
here is it:
I want to fill out global variable "student_marks" with a grade for each student and keep it once is loaded. So it means without calling the function "def add_mark()" I will be able to print just global variable "student_marks" with its all students and marks.
I can do it in interpreter but not in script code. Pls, I need your help.
I approciate it, many thanks!
student_list=['juraj','kristina','peto','alica','vlado','natalia','roman','silvia']
student_marks = {}
def add_student(student):
student_list.append(student)
def remove_student(student):
student_list.remove(student)
def marks_student(student_list):
for student in student_list:
student_marks[student]=[]
return student_marks
def add_mark():
global student_marks
number_students=len(student_list)
for n in range(number_students):
student_marks[raw_input('student')].append(raw_input('mark'))
return student_marks
def main():
marks_student(student_list)
#print student_marks
add_mark()
print student_marks1
## add_mark('juraj','A')
## add_mark('kristina','B')
## add_mark('peto','A')
## add_mark('alica','C')
## add_mark('vlado','A')
## add_mark('natalia','B')
## add_mark('roman','A')
## add_mark('silvia','C')
#print student_marks
if __name__ == '__main__':
main()