You are on page 1of 1

MIT CAMPUS, ANNA UNIVERSITY

GE 5161 - PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY


DEPARTMENT OF ELECTRONICS ENGINEERING
END SEMESTER EXAM

DATE: BATCH: ECE_SS SYSTEM NO:


REG NO: SERIAL NO:

Write an Algorithm, pseudocode and draw a flow chart to check whether given
number is Niven number or not.
Note:
C1 A Niven number is any whole number that is divisible by the sum of its digits. 25

For example, 126 is a Niven number because, the sum of its digits 1+ 2 + 6, is 9,
and 9 goes into 126 exactly 14 times

Write a program that reads an integer and displays all its smallest factors in
increasing order.
C2 For example: 25
if the input integer is120, the output should be as follows: 2,2,2,3,5

Create a function called check_third_element that takes in a tuple of tuples, tups as


a parameter. Tuples must have at least 3 items. Return a new tuple that contains the
third element of each tuple.
C3 25
For example:
check_third_element(((1,2.2,3.3),(-1,-2,-3),(0,0,0))) would return (3.3, -3, 0).

Write a function called listarg that takes in list as a parameter and returns a new list
with the words from list that start with “a”.

C4 For example: 25
listarg(["alphabet", "apple", "banana", "coding", "amazing"]) would
return ["alphabet", "apple", "amazing"].

You might also like