0% found this document useful (0 votes)
96 views

Python Prac Wrtques - Assignment 1

This document contains 17 questions for a Python programming assignment. The questions cover topics like nested lists, appending to lists, checking number ranges, string manipulation, dictionaries, loops, functions with kwargs, conditional logic, and calculating food delivery bills. Students are asked to write Python code to solve each problem posed in the questions.

Uploaded by

Ranveer Bodhale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Python Prac Wrtques - Assignment 1

This document contains 17 questions for a Python programming assignment. The questions cover topics like nested lists, appending to lists, checking number ranges, string manipulation, dictionaries, loops, functions with kwargs, conditional logic, and calculating food delivery bills. Students are asked to write Python code to solve each problem posed in the questions.

Uploaded by

Ranveer Bodhale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Dr. D. Y.

Patil Pratishthan’s
D. Y. Patil Institute of Master of Computer Applications & Management
Sector No.29, Behind Akurdi Railway Station, Pradhikaran, Nigdi, Pune – 411044
Tel No: 020-27640998, 202737393, Fax no: 27653054,
Website: www.dypimca.ac.in, Email: [email protected]
(Approved by AICTE, Recognized by DTE, Mah.; Affiliated to SPPU)

Python Practical Assignment I

MCA – I (Sem – II) Academic Year 2023-2024 (Term: Jan - Jun 2024)
Lab: IT-21L Python Programming Course Out-Come: CO1 BT Level 3, 5 and 6

Q.1. Write a python program to extend nested list by adding the sublist after 'g'
list1=['a','b',['c',['d','e',['f','g'],'k'],'l'],'m','n']
sublist=['h','i',j]

Q.2. Write a prog. to add item 7000 after 6000 in the following list using append() function
[10,20,[300,400,[5000,6000],500],30,40]

Q.3. Write a program to check whether the given number is in between 1 and 100.
Q.4.Write a program to display flag color based on flag color code using ladder if else.
Q.5. Write a program to print characters present in string index wise
Q.6. Display numbers from 10 to 1 in descending order.
Q.7. key=[‘name’,’age’,’city’,’is_student’] , Write a program to add values for this key into
dictionary using for loop
Q.8. Write a program to add 5 entries into empty dictionary using for loop take key-value from user
for each entry.

Q.9. Write a program to print sum of positive integers when user enter negative value break the loop
(while)

Q.10. Write a program to check whether entered string and number is palindrome or not

Q.11. Write a program to display all position of substring in a given main string.

Q.12. Write a program to reverse the content of each word.


Eg. I/P: Learning python is very easy
o/p:gninraeL nohtyp si yrey ysae

Q.13. Write a program to print characters at odd position and even position for the given String?
Q.14. Write a Program to merge characters of 2 strings into a single string by taking characters
alternatively.
Q.15. Write a program for the following requirement
input: a4b3c2 output: aaaabbbcc
Q.16. Write a program to remove duplicate characters from the given input string?
input: ABCDABBCDABBBCCCDDEEEF
output: ABCDEF
Q.17. Write python program to display subject name with marks of that subject using
KWARGS that is variable length.

Q. 18.An organization has decided to provide salary hike to its employees based on their job
level. Employees can be in job levels 3,4 or 5.
Hike percentage based on job levels are given below:
Job level Hike Percentage(applicable on current salary)
3 15
4 7
5 5
In case of invalid job level, consider hike percentage to be 0.
Given the current salary and job level, write a python program to find and display the new salary of
an employee.

Q. 19. Food Corner home delivers vegetarian and non-vegetarian combos to its customer based on
order.
A vegetarian combo costs Rs.120 per plate and a non-vegetarian combo costs Rs.150 per plate.
Their non-veg combo is really famous that they get more orders for their non-vegetarian combo
than the vegetarian combo.
Apart from the cost per plate of food, customers are also charged for home delivery based on the
distance in kms from the restaurant to the delivery point. The delivery charges are as mentioned
below:
Distance in kms Delivery charge in Rs per km For first 3 kms 0
For next 3 kms 3
For the remaining 6
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.

Mrs.Sapna Sharma and Mrs Hemangi Kolhe Dr. Kavita Suryawanshi


Lab Teacher HOD-MCA & Vice Principal

You might also like