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

PythonLab

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

PythonLab

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

Date : 22/08/2023

Lab Assignments 1

Subject: MCA-R308 Lab-9: Python Programming


1. Create a list and perform the methods: insert ( ), remove ( ), append ( ), len( ), pop( ) clear( )
2. Create a dictionary and apply the methods: Print the dictionary items, access items, get( ),
change values, use len( )
3. Create a tuple and perform the methods: Add items, Check for item in tuple , Access items
Length of tuple
4. Start with the list [18, 19, and 11]. Do the following:
(a) Set the second entry (index 1) to 17 (b) Add 4, 5, and 6 to the end of the list
(c) Remove the first entry from the list (d) Sort the list
(e) Double the list (f) Insert 25 at index 3 Print the final list
5. Program that takes any two lists L and M of the same size, adds their elements together to
form a new list N whose elements are sums of the corresponding elements in L and M.
For instance, if L=[13,11,14] and M=[11,15,19], then N should equal [24,26,33].
6. Python program to print a number is positive/negative using if-else.
7. Python function that takes two lists and returns True if they are equal otherwise false.
8. Ask the user for a temperature. Then ask what units, Celsius or Fahrenheit, the temperature is
in. The program should convert the temperature to the other unit.
The conversions are F = 9/5* C + 32 and C = 5/9(F − 32).
9. Create a function sum_digits which accept integer num and returns the sum of its digits.
10. Write a function that takes an integer and returns a list of its factors.
11. Define function verbose that accept integer less than 1015, returns the name of the integer in
English. Example, verbose (123) should return one hundred twenty-three
12. Write a program to double a given number and add two numbers using lambda ( ).
13. Write a program for filter ( ) to filter only even numbers from a given list.
14. Write a program for map ( ) function to double all the items in the list.
15. Write a program to find sum of the numbers for the elements of the list by using reduce ( ).
(Note: Last date of submission is 30/08/2023)
Dr.S.N.Lokhande

You might also like