- Home
- Course Detail
regularpython@gmail.com
You are now watching:
Python Operators / of Python Comparison Operator Real Time Examples
from beautifultable import BeautifulTable table = BeautifulTable() table.column_headers = ["Movie Name", "Language", "Movie Length (min)"] import MySQLdb try: connection = MySQLdb.connect(user='root',password='sairam143sairam',port=3306,host='localhost') print('Database Connected..') except Exception as e: print(e) else: tutorialCursor = connection.cursor() tutorialCursor.execute("SELECT movie_name,movie_language,movie_length FROM bulkratings_info.tutorialstution_movies_list;") movies = tutorialCursor.fetchall() print(movies) # group_B = 100 #length of movie # for movie in movies: # # try: # print(movie) # group_A = int(movie[2]) # if movie[1] == 'Telugu' and int(movie[2]) >= 150: # table.append_row([movie[0], movie[1], movie[2]]) # if group_A == group_B: # group_a == 100 # table.append_row([movie[0], movie[1], movie[2]]) # except: # pass # # print(table)