from tkinter import * from PIL import ImageTk , Image from sqlite3 import * from tkinter import ttk from tkinter import messagebox import time def create (): global BILL_N , BILL_A , BILL_A_DUE , BILL_UNITS conn = connect ( 'database.db' ) # c = conn . cursor () # c.execute('''CREATE TABLE K_BILL (account_number integer PRIMARY KEY, # name text, # units integer, # amount_due integer, # amount integer)''') # c.execute(''' INSERT INTO K_Bill VALUES (4902233658724, 'SAMIULLAH', 800 , 20267,800*13)''') # c.execute(''' INSERT INTO K_Bill VALUES (3769186408275, 'Ali', 25000, 25267,436*13)''') # c.execute(''' INSERT INTO K_Bill VALUES (9863867106183, 'Faez', 22000, 22567,658*13)''') c . execute ( ''' UPDATE K_BILL set units=436 wh...
Popular posts from this blog
from tkinter import * from PIL import ImageTk , Image from sqlite3 import * from tkinter import ttk from tkinter import messagebox import time # Save updated record def update_record (): # Grab record number selected = my_tree . focus () # Save new data my_tree . item ( selected , text = "" , values =( upd_id , items_entry . get (), address_entry . get (), Email_entry . get (), Ph_No_entry . get (), Price_entry . get ())) #update database conn = connect ( 'database.db' ) c = conn . cursor () c . execute ( '''UPDATE CHECKOUT SET items=?, address=?, email=?, ph_No=?, price=? WHERE id=?''' , (( items_entry . get (), address_entry . get (), Email_entry . get (), Ph_No_entry . get (), Price_entry . get (), id ,))) conn . commit () conn . close () ...
20. Valid Parentheses Easy 18.3K 1K Companies Given a string s containing just the characters '(' , ')' , '{' , '}' , '[' and ']' , determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Example 3: Input: s = "(]" Output: false Constraints: 1 <= s.length <= 10 4 s consists of parentheses only '()[]{}' . My code: class Solution: def isValid(self, s: str) -> bool: a='([{' b=')]}' c=[] for i in s: if i in a and s.count(i)!=s.count(b[a.find(i)]):#checks if no.of opening element==no of closing element print(i,b[...
Comments
Post a Comment