UCEST105- Lab Cycle 5

Learning Objective

  • Learn to use List,Dictionary and set

List, Dictionary, set ( try the various operators and functions before attempting programs)

1.Read 'n' numbers into a list and find the min,max,sum and average.
2.Read names of 'n' students into a list and sort them in alphabetical order.
3.Generate list of all even numbers less than 100. ( use list comprehension)
4. Input two lists from the user. Merge these lists into a third list such that in the merged list, all even numbers occur first followed by odd numbers. Both the even numbers and odd numbers should be in sorted order.
5.Implement the set operation on two sets ( Union, intersection, difference and symmetric difference)
6.Read a binary string and count the number of 1's and 0's .Use a dictionary to store the result.
7.Read a string and print the words in sorted order after removing duplicate words.( remove the repetition)
8.Find  the frequency of occurrence of each character in a string.( use dictionary)
9.Write a Python script to create a dictionary where the keys are numbers between 1 and 15 (both included) and the values are square of keys.
10.Write a Python program to read list of positive integers and separate the prime and composite numbers into two different list.( Use a function to check primality)
11.Write a program to read N words and display them in the increasing order of their lengths. The length of each word is also to be displayed. ( use dictionary)
12.Find the mode of elements in an array. Mode is the value that appears most frequently in the array.
13.Write a recursive function to find the sum of elements in a list.
14.Write a recursive function to find the maximum element in a list.
15.Write a recursive function to count the occurrence of a value in a list.
16.Write a program to read N words and display them in the increasing order of their lengths. The length of each word is also to be displayed. ( university question)

Comments

Popular posts from this blog

Algorithmic Thinking with Python UCEST 105- KTU First Semester BTech Course 2024 scheme notes pdf - Dr Binu V P 9847390760

Lab Experiments and Solutions - Algorithmic thinking with Python KTU S1 2024 scheme

UCEST 105 Lab Cycle - 1