Professional Documents
Culture Documents
App Notepad
App Notepad
Given
a list of a
tuple, the task is to remove all the tuples from list, if it’s greater than n (say
100)
# driver code
s1 = str(input())
s2 = str(input())
check(s1, s2)
3 Months of Units Consumed). Predict the no. of units that will be consumed in the
next month
as same, unpredict. (Hint: average of three months is less than or equal to last
month of unit
print("------------------")
print("Bill Id : BCus_00",n)
print("Customer ID : ",customerID)
print("Customer Name : ",customerName)
print("Last Month units consumed : ",lastMonth)
print("Average of Last 3 Months Of Units : ",'%.2f' %average)
if average <= lastMonth:
print("Usage : Domestic")
else:
print("Usage : Commercialized")
n+=1
print("-------------------")
Design a GUI for the following scenario :
Imagine you as an internal Health Inspector in a Hospital. Now your duty is to
check the state of readiness of hospital in admitting the Corona Affected patients
by maintaining a Covid-19 database with the following column name in the Readiness
table,
Total Number of Doctors,
Total Number of Nurses,
Total Number of Health Care Assistants,
Number of Beds in Covid 19 ward,
Number of Beds in Covid 19 ICU ward,
Total Number of Oxygen Cylinders and
Total Number of Ventilator Units
Also, you must keep track of number of people who has taken their Covid-19
Vaccination from the month of January 2021 with the following column name in the
same database as a Vaccination table,
Name of the person,
Date of Vaccination,
Aadhar Number,
Date of Birth,
Age,
Dosage Count
Design your own form using python tkinter in getting the inputs for the above
mentioned tables and also display the records of ta
bles stored in the database.
conn = sqlite3.connect('COVID19.db')
cursor = conn.cursor()
window=Tk()
window.title("COVID DETAILS")
window.geometry("440x550")
window.config(bg='white')
def update_data():
conn = sqlite3.connect('COVID19.db')
cursor = conn.cursor()
cursor.execute("INSERT INTO readiness VALUES(:e1, :e2, :e3, :e4, :e5, :e6)",
{
'e1': e1.get(),
'e2': e2.get(),
'e3': e4.get(),
'e4': e4.get(),
'e5': e5.get(),
'e6': e6.get()
})
def details():
newwindow = Tk()
newwindow.title("Details")
newwindow.geometry("900x300")
conn = sqlite3.connect('COVID19.db')
cursor = conn.cursor()
print_details2 = ''
for detail2 in details2:
print_details2 +="\n" + "Vaccination Table" + "\n" + "Name of the person =
" + str(detail2[0]) + " | " + "Date of Vaccination = " + str(detail2[1]) + " |
" + "Aadhar Number = " + str(detail2[2]) + "\n" + " | " + "Date of Birth = " +
str(detail2[3]) + " | " + "Age = " + str(detail2[4]) + " | " + "Dosage Count =
" + str(detail2[5]) + "\n"
conn.commit()
conn.close()
newwindow.mainloop()
input 10,24,34,42,19
REVERSEHELLOMULTITHREADED
def print_cube(num):
"""
function to print cube of given num
"""
print("Cube: {}".format(num * num * num))
def print_square(num):
"""
function to print square of given num
"""
print("Square: {}".format(num * num))
if _name_ == "_main_":
# creating thread
t1 = threading.Thread(target=print_square, args=(10,))
t2 = threading.Thread(target=print_cube, args=(10,))
# starting thread 1
t1.start()
# starting thread 2
t2.start()
n = int(input())
s = list(map(int, input().split()))
d, m = map(int, input().split())
ans = 0
for i in range(n-m+1):
if (sum(s[i:i+m]) == d):
ans += 1
print(ans)
FUNCTION SQUARE
def square(n):
n = n**2
return n
def twice(f):
return square(f)
n = int(input("Enter a number: "))
quad = twice(square(n))
print(quad)
nfa = NFA(
states={'q0', 'q1', 'q2', 'q3'},
input_symbols={'a', 'b'},
transitions={
'q0': {'b': {'q3'}, 'a': {'q1'}},
'q1': {'a': {'q3'}, 'b': {'q2'}},
'q2': {'a': {'q1'}, 'b': {'q3'}},
'q3': {'a': {'q3'}, 'b': {'q3'}},
#'q4': {'0': 'q0', '1': 'q1'}
},
initial_state='q0',
final_states={'q2'}
)
n = str(input())
if nfa.accepts_input(n):
print("ACCEPTED")
else:
print("REJECTED")