You are on page 1of 1

SHRI G. S.

INSTITUTE OF TECHNOLOGY & SCIENCE, INDORE


DEPARTMENT OF COMPUTER ENGINEERING
M.Tech I Year
CO71221: MACHINE LEARNING

Lab Assignment: 01

1. Write a program on string and perform basic operation on number in python.


2. Write a python program to convert a given decimal number into binary, octal and
hexadecimal numbers.
3. Define a function which can print dictionary where the keys are numbers between 1 and
20(both included) and the values are square of keys.
4. Write a program to find out the grade of given percentage value (from user) & print the
message according to given criteria i.e.
< 70% = A grade
65% < P < 70% = B+ grade
60% < P < 65% = B grade
55% < P < 60% =C grade
P < 55% = Fail
5. Write a python program to play any audio file.
6. Write a python program to print the following star pattern: for n=3
***
* *
***
7. Write a program which elaborate the concept of ranges (a), range (a, b) & range (a, b, c).
8. Write a program to sum a list with 10 numbers and count the number of zeros in the
following tuple: a= (10, 1000, 505, 0, 0, 1).
9. State the difference between syntax error and exception with the help of python program.
10. Write a recursive function to calculate the sum of the cube of first n natural numbers.
11. Write a program which accepts a sequence of words separated by whitespace as input to
print the words composed of digits only.
Example: If the following words are given as input to the program:
2 cats and 3 dogs. Then, the output of the program should be:
['2', '3'] In case of input data being supplied to the question, it should be assumed to be a
console input.

You might also like