import mysql.connector as mysql
db = mysql.connect(
host="localhost",
database="raj",
user="raj",
passwd="r123",
auth_plugin='mysql_native_password'
)
capacity = 10
query = '''
select bcode,rnumber
from room
where cap <= %s
'''
cursor = db.cursor()
cursor.execute(query,(capacity,))
records = cursor.fetchall()
if len(records) == 0:
print('No rooms')
else:
for record in records:
print(record[0], record[1])
t1 = (5)
print(t1)
t2 = (5,)
print(t2)
t2[0]