Help please


Hi, I am new to any type of programming and python is my first language. I am trying to write a program to Implement a Grade System using List( i have to use list only)
with following operations:
Add (name, grade) into the database, Output all records in the database with grades sorted
Output the average grade and max grade of the database
Find a record using name , Find records using grade

I have written this till now
database = [] # Global List
while 1:
name = raw_input('Enter name:')
grade = raw_input('Enter grade:')
if name == 'ok':
database.append((name, grade))
print database.sort(key=lambda b: b[1])

output (tuple)

[('tom', '50'), ('mk', '45')]

.......Now i need to calculate the average and max grade, I know how to calculate the average but dont know how to change grade '50' to integer 50

Please help and suggest
**I am using python 2.7


google search
== discussions / opinions == ( about 4 million programmers use this )
python convert string to integer

== the Book ==


Thanks, but, just solved it by isolating the second element from tuple, assigning it a var and then converting it to int.