You are on page 1of 2

TPI Python (Level-4) Final Assessment

1. Suppose you work for a secret intelligence agency, and you've been tasked
with creating a program to encrypt sensitive messages stored in text files. To
ensure maximum security, you've decided to reverse the order of letters in
each word of the message. (5 - Marks)

Example Message (input.txt):

Expected Encrypted Message (output.txt):


2. Suppose we have a database for a store with the following tables:(5 - Marks)

Write an SQL query for each of the following scenarios:

a. Find all products whose name starts with 'S'.


b. Retrieve all products whose name contains 'shirt' anywhere in the
name.
c. List the names of products sorted in descending order of price.
d. Calculate the total sales amount for each category
e. Count the number of products priced above $50.

You might also like