Skip to content
Sign upLog in
Profile icon

Sakura Kimiko

@SakuraKimiko
Repls
Community
SakuraKimiko
SakuraKimiko
shared a Post
3 years ago
3
Adding an ID to student name list
Hello I am trying the following code and to do the follows in PYTHON CODE I want to start adding student by starting a blank list along with auto g
teymour
teymour
You might want to use an SQL database to achieve this – they come with handy features that make life easier and are highly performant. If you want to use a python list then whenever a new student is created an ID could be provisioned using student_list = [ {id: 1, name: 'name1', email: '[email protected]'}, # Extra fields can be added as is necessary {id: 2, name: 'name2, email: '[email protected]'} And so on ... ] You can do a linear search to find the student. userid=int(input(""Your user id3 years ago