0% found this document useful (0 votes)
4 views2 pages

Python Modules Question Paper

The document contains a series of programming questions related to Python code outputs, focusing on functions from the math and statistics libraries, as well as random number generation. It asks for predictions of outputs for various code snippets and inquiries about data types and mutability of different data structures. The questions cover concepts such as floor, ceil, absolute value, mean, median, mode, and random number generation.

Uploaded by

Krishna kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Python Modules Question Paper

The document contains a series of programming questions related to Python code outputs, focusing on functions from the math and statistics libraries, as well as random number generation. It asks for predictions of outputs for various code snippets and inquiries about data types and mutability of different data structures. The questions cover concepts such as floor, ceil, absolute value, mean, median, mode, and random number generation.

Uploaded by

Krishna kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

21.

Predict the output of the following code:

import math

val = -5.7
print([Link](val))

Output: ____________________

22. What will be printed when the following code is executed?

import math

print([Link](12.1))

Output: ____________________

23. Identify the final output generated by the following code:

result = abs(-9.5) + abs(3)


print(result)

Output: ____________________

24. Find the output produced by the following code:

import statistics

scores = [20, 40, 30, 30]


print([Link](scores))

Output: ____________________

25. Predict the exact output displayed by the following code:

import statistics

items = [10, 5, 7, 7, 3]
print([Link](items))

Output: ____________________

26. What will be the result of running the following code?

import statistics

points = [7, 2, 7, 4, 7, 2]
print([Link](points))

Output: ____________________
27. State the minimum and maximum integer that can be generated by the following code:

import random

print([Link](10, 20))

Output: ____________________

28. Analyze the code and list all possible outputs:

import random

print([Link](5, 16, 5))

Output: ____________________

29. Find datatype of following data:

(23, 45,67,88)

“567”

[67, 78]

{‘A’:2, ‘B’:9}

30. Find whether data is mutable or not

(23, 45,67,88)

“567”

[67, 78]

{‘A’:2, ‘B’:9}

You might also like