title: create student database in python
body: <p>I'm a beginner in python. I have created a database for student in python. I'm not able to get the output for all iterations in dict. </p>
  
  <p>my source code:- </p>
  
  <pre><code>n = int(raw_input("Please enter number of students:"))
  
  student_data = ['stud_name', 'stud_rollno', 'mark1', 'mark2','mark3','total', 'average'] for i in range(0,n):
  
      stud_name=raw_input('Enter the name of student: ')
      print stud_name
  
  
      stud_rollno=input('Enter the roll number of student: ')
      print stud_rollno
  
  
      mark1=input('Enter the marks in subject 1: ')
      print mark1
  
      mark2=input('Enter the marks in subject 2: ')
      print mark2
  
      mark3=input('Enter the marks in subject 3: ')
      print mark3
  
      total=(mark1+mark2+mark3)
      print"Total is: ", total
  
      average=total/3
      print "Average is :", average
  
  dict = {'Name': stud_name, 'Rollno':stud_rollno, 'Mark1':mark1, 'Mark2':mark2,'Mark3':mark3, 'Total':total, 'Average':average} print "dict['Name']: ", dict['Name'] print "dict['Rollno']: ", dict['Rollno'] print "dict['Mark1']: ", dict['Mark1'] print "dict['Mark2']: ", dict['Mark2'] print "dict['Mark3']: ", dict['Mark3'] print "dict['Total']: ", dict['Total'] print "dict['Average']: ", dict['Average']
  </code></pre>
  
  <p>if i give no of students as 2, I'm getting dict for 2nd database only and not for 1st one too.</p>
  
  <p>output that i got</p>
  
  <pre><code>Please enter number of students:2
  Enter the name of student: a
  a
  Enter the roll number of student:1
  1
  Enter the marks in subject 1:1
  1
  Enter the marks in subject 2:1
  1
  Enter the marks in subject 3:1
  1
  Total is:3
  Average is :1
  Enter the name of student:b
  b
  Enter the roll number of student:2
  2
  Enter the marks in subject 1:2
  2
  Enter the marks in subject 2:2
  2
  Enter the marks in subject 3:2
  2
  Total is:6
  Average is :2
  dict['Name']:b
  dict['Rollno']:2
  dict['Mark1']:2
  dict['Mark2']:2
  dict['Mark3']:2
  dict['Total']:6
  dict['Average']:2
  </code></pre>