Professional Documents
Culture Documents
Set A
Set A
Data=input(“enter data”)
fob=open(‘record.txt’, 'w'):
fob.write(data)
# b. Read and display the number of words present in the text file
content = fob.read()
words = content.split()
prinlen(words)
# c. Display all data of the text file after changing the case of each character
fob=open(‘record.txt’, 'r'):
content = fob.read()
print(content.upper())
content =fob.read()
words = content.split()
count=0
for I in words:
if I[0].isupper():
count+=1
print(count)
import mysql.connector as mc
# A. In SQL create a table EMPLOYEE (empno, empname, salary) and add two records.
conn =mc.connect(host=’localhost’,user=’root’,password=’school@123’)
cursor = conn.cursor()
conn.commit()
conn.commit()
all_data = cursor.fetchall()
print(row)
record = cursor.fetchone()
if record:
else: