11.Programming Assignment 2( Programs using built-in functions and modules)

Read the blog post https://pythonformlktuminor.blogspot.com/2020/08/built-in-functions-modules-and-packages.html before attempting the following programs

Programs to try using built in functions ,modules and  packages

1.Read a number in decimal and convert it into different bases.
2.Read a binary number (Eg: 0b101010) and convert it into different bases.( use eval,oct,hex functions)
3.Read a hexa decimal number (Eg: 0xa3) and convert it into different bases.
4.Read an octal number (Eg:012) and convert it into different base.
5.Read a string and find the length.( use len)
6.Find the biggest and smallest of three numbers.( use min and max function)
7.Read a number and find its factorial. ( use factorial function from math)
8.Find the number of digits in the factorial of a given number.( convert into string and find length)
9. Read a Year and print the calendar of that year
(Hint: import calendar ;print(calendar.calendar(2017)) will display 2017 calendar.
10.Read a Year and month and print the calendar of the specified month.
(Hint: print(calendar.month(2017,8) )will display 2017 August month calendar)
11.Print a random number between 1 and 100 ( use random module)
12.Print the python version you are using ( use sys module)
13.Print the files in the current directory ( use os module)

Comments

Popular posts from this blog

Python For Machine Learning - CST 283 - KTU Minor Notes- Dr Binu V P

46.Classes and Objects in Python- Accessors and mutators

KTU Python for machine learning Sample Question Paper and Answer Key Dec 2020