We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
CS4051 Fundamentals of Computing
Lab work – week 7
1. Write a function that takes a word as input and counts the number of vowels present in the word. 2. A palindrome is a word or a sequence of characters which reads the same backward as forward, such as madam or racecar. Write a function that takes a word as input and determines whether it is a palindrome or not. 3. Write a program that takes input from the user a string of numbers (eg. “24453”), then all the numbers from the string must be put in a list and their sum should be printed out. 4. Write a program that takes 2 words as input from the user and prints out a list containing the letters which the 2 words have in common. For example if word1 is “english” and word2 is “nepali”, the output should be [“l”, “e”, “i”, “n”]. 5. Write a program that takes as input the names and marks obtained on a certain subject of N students. Then the data must be stored in a dictionary with the names as keys and marks as values. Then find out the highest, lowest and average marks obtained and write the results to a file named “result.txt”. 6. The file “lab7.txt” contains 16 numbers separated by commas and divided into 4 lines. Write a program that reads the numbers from the file and finds out the sum of all the numbers, and the maximum and minimum number.