Write a program to manually enter the entries like Sr_no,First_name,Last_name,AGE,SEX,INCOME,CAST in a Table.

import MySQLdb

db=MySQLdb.connect(‘localhost’,’username’,’pasword’,’databsename’)
cur=db.cursor()

print ‘Welcome to IGDTUW’
print ‘Please enter your details’
Sr_no=raw_input(‘Serial No.:’)
fname=raw_input(‘First name: ‘)
lname=raw_input(‘Last name: ‘)
age=raw_input(‘Age: ‘)
sex=raw_input(‘sex: ‘)
income=raw_input(‘Income: ‘)
cast=raw_input(‘cast: ‘)

cur.execute(‘INSERT INTO tablename(Sr_no,First_name,Last_name,AGE,SEX,INCOME,CAST)VALUES(%s,%s,%s,%s,%s,%s,%s)’,(Sr_no,fname,lname,age,sex,income,cast))
db.commit()

db.close()