CSP0307
CSP0307
CSP0307
References
Mark Lutz; Programming Python; O’reilly.
Dusty Philips; Python 3 Object Oriented Programming, PACKT Publishing.
Steve Holden and David Beazley; Python Web Programming; New Riders.
Resources A computer system with following configuration:
Pentium P4/2.8 GHz (or higher) Processer Speed;
Windows XP (or higher) / Linux Operating System;
1 GB (or higher) RAM; 160 GB (or higher) HDD;
Jupiter Notebook, Python 3.6
Learning Outcomes After successful completion of this course, students
would be able to:
4 Program to Accept Three Digits and Print all Possible Combinations from the Digits. 1.0 Hours
5 Program to Find the Sum of the Series: 1 + x^2/2 + x^3/3 + … x^n/n. 1.0 Hours
6 Program to Create a List of Tuples with the First Element as the Number and Second Element as the
Square of the Number. 1.0 Hours
7 Program to Count the Frequency of Words Appearing in a String Using a Dictionary. 1.0 Hours
9 Program that Displays which Letters are in the First String but not in the Second 1.0 Hours
10 ARS Gems Store sells different varieties of gems to its customers. Write a Python program to calculate
the bill amount to be paid by a customer based on the list of gems and quantity purchased. Any
purchase with a total bill amount above Rs.30000 is entitled for 5% discount. If any gem required by
the customer is not available in the store, then consider total bill amount to be -1. Assume that quantity
required by the customer for any gem will always be greater than 0. Perform case-sensitive comparison
wherever applicable. 1.0 Hours
11 Given a list of integer values. Write a python program to check whether it contains same number in
adjacent position. Display the count of such adjacent occurrences.
1.0 Hours
13 Program to Read a File and Capitalize the First Letter of Every Word in the File. 1.0 Hours
14 Program to Create a Class which Performs Basic Calculator Operations 1.0 Hours
PBL.
1. A traveler on a visit to India is in need of some Indian Rupees (INR) but he has money
belonging to another currency. He wants to know how much money he should provide in the
currency he has, to get the specified amount in INR. Write a python program to implement a
currency calculator which accepts the amount needed in INR and the name of the currency
which the traveler has. The program should identify and display the amount the traveler should
provide in the currency he has, to get the specified amount in INR.
Note: Use the forex information provided in the table below for the calculation. Consider that
only the currency names mentioned in the table are valid. For any invalid currency name,
display -1.
Given the type of food, quantity (no. of plates) and the distance in kms from the restaurant to
the delivery point, write a python program to calculate the final bill amount to be paid by a
customer. The below information must be used to check the validity of the data provided by the
customer:
Type of food must be ‘V’ for vegetarian and ‘N’ for non-vegetarian.
Distance in kms must be greater than 0.
Quantity ordered should be minimum 1.
If any of the input is invalid, the bill amount should be considered as-1.
3. The Metro Bank provides various types of loans such as car loans, business loans and house
loans to its account holders. Write a python program to implement the following requirements:
Initialize the following variables with appropriate input values:account_number,
account_balance, salary, loan_type, loan_amount_expected and
customer_emi_expected.
The account number should be of 4 digits and its first digit should be 1.
The customer should have a minimum balance of Rupees 1 Lakh in the account.
If the above rules are valid, determine the eligible loan amount and the EMI that the
bank can provide to its customers based on their salary and the loan type they expect to
avail.
The bank would provide the loan, only if the loan amount and the number of EMI’s
requested by the customer is less than or equal to the loan amount and the number of
EMI’s decided by the bank respectively.
Display appropriate error messages for all invalid data. If all the business rules are satisfied
,then display account number, eligible and requested loan amount and EMI’s.
Test your code by providing different values for the input variables.
No. of EMI’s required to
Salary Loan type Eligible loan amount
repay
> 25000 Car 500000 36
> 50000 House 6000000 60
> 75000 Business 7500000 84