def login():
    userid = input('Enter UserID : ')
    query = 'select * from login;'
    try:
        cursor.execute(query)
        fetch = cursor.fetchall()
        n = len(fetch)
        flag = 0
        for i in range(n):
            if (userid == fetch[i][0]):
                pswd = input('Enter password : ')
                if (pswd == fetch[i][1]):
                    print('Login successfully :)')
                    flag = 1
                else:
                    print("UserID and password doesn't match")
                    flag = 1
        if (flag == 0):
            print('NO such user exist!, redirecting to Sign Up page')
            sign_up()
    except:
        db.rollback()
def login():
    userid = input('Enter UserID : ')
    query = 'select * from login;'
    try:
        cursor.execute(query)
        fetch = cursor.fetchall()
        n = len(fetch)
        flag = 0
        for i in range(n):
            if (userid == fetch[i][0]):
                pswd = input('Enter password : ')
                if (pswd == fetch[i][1]):
                    print('Login successfully :)')
                    flag = 1
                else:
                    print("UserID and password doesn't match")
                    flag = 1
        if (flag == 0):
            print('NO such user exist!, redirecting to Sign Up page')
            sign_up()
    except:
        db.rollback()