Professional Documents
Culture Documents
Problem Set 1
Problem Set 1
Problem Set I
Group A
1. Check the datatypes of (i) 346.89, (ii) 14/5, (iii) 20/3.0, (iv) 2(3+6j), (v) ‘12345’
2. Are the following statements alright? Type and check. Find the errors, if any. (i) 6x = 6x, (ii) x8
= x8, (iii) x5 = x*5, (iv) x*3 = 3*x
3. Import the module ‘sys’ on your namespace. Check the directory and find out a possible
function there in the directory to check your Python version.
4. Print the calendar of March 2022.
5. Print the The Zen of Python poem.
6. Print 0.000053 in exponential format.
7. There is a module called, ‘platform’ in core Python. Import this module and use a function
system() from it to check which operating system you are using.
8. Import the time module and find out the python object to print out local date time.
9. Take three numbers: integer, float and complex: 34, -56.98, 5 + 2j. Take the product
of the three numbers and find out the type of the output.
10. Suppose we have three strings, x = ‘Hello friends!’, y = ‘That is why I feel good.’, z = ‘I learnt
Python.’ Can you print the three strings together to have a meaningful conversation?
11. Convert the decimal number 5983 into a (i) binary, (ii) hexadecimal, and (ii) octal number.
12. Use the built-in function to find the maximum and minimum among the following numbers: −1,
2, 10, 13, 3.5, 71.9, 23, −34, 0, 0.98, 11.3, 10
13. Write a Python script which accepts the first and last name of the user and print them in reverse
order with a gap between them.
Group B
14. Import the special numbers 𝑒 and 𝜋 from math module. Round off each number up to 3 decimal
points and then find the value of 𝑒𝜋 2 .
15. Check the famous Euler identity: 𝑒 𝑖𝜋 = −1. [Take 𝜋 from math module.]
16. Verify: ln 100! ≈ 100 ln 100 − 100.
√5+1
17. Evaluate the Golden ratio 2
in decimal fraction and print that up to 5 decimal points.
18. Write a Python program to compute 𝑧, where 𝑧 = 𝑥(𝑥 − 𝑦)/(𝑥 + 𝑦) with 𝑥 = 5, 𝑦 = 9. Print
the output and check the datatype of 𝑧.
𝑁!
19. Compute for 𝑁 = 7, 𝑛 = 3 [Use function factorial() from math module.]
𝑛!(𝑁−𝑛)!
20. Prove the following identity numerically for the angle 𝜃 = 470 :
cos 5𝜃 = 16 cos5 𝜃 − 20 cos3 𝜃 + 5 cos 𝜃
tan 𝛼+tan 𝛽
21. Check the trigonometric identity: tan(𝛼 + 𝛽) = 1−tan 𝛼 tan 𝛽 for 𝛼 = 42𝑜 and 𝛽 = 340 .
22. Given, the Cartesian coordinates of two points: 𝑝1 = (2, 3, 5) and 𝑝2 = (9, 0, −1). Write a
Python code to compute the distance between the two points.
23. A square is inscribed inside a circle of radius 5 unit. Compute the areas of the circle and the
square and find the ratio between them to find out the value of pi.
Group C
[You may use appropriate built-in functions to verify or compute. Disregard the problems in Group C
until some further modules and concepts are introduced.]