No Result
View All Result
Sunday, September 24, 2023
  • Login
Getting Placed
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship
No Result
View All Result
Getting Placed
No Result
View All Result

Python MCQ’s on Modules: SET 5

Abhishek by Abhishek
March 13, 2021
in Python
0
python

41. Which of the following aren’t defined in the math module?

a) log2()

b) log10()

c) logx()

d) none of the mentioned

Check Answer

Answer: c
log2() and log10() are defined in the math module.

 

 

42. What is returned by int(math.pow(3, 2))?

a) 6

b) 9

c) error, third argument required

d) error, too many arguments

Check Answer

Answer: b
math.pow(a, b) returns a ** b.

 

43. What is output of print(math.pow(3, 2))?

a) 9

b) 9.0

c) None

d) None of the mentioned

Check Answer

Answer: b
math.pow() returns a floating point number.

 

44. What is the value of x if x = math.sqrt(4)?

a) 2

b) 2.0

c) (2, -2)

d) (2.0, -2.0)

Check Answer

Answer: b
The function returns one floating point number.

 

45. What does math.sqrt(X, Y) do?

a) calculate the Xth root of Y

b) calculate the Yth root of X

c) error

d) return a tuple with the square root of X and Y

Check Answer

Answer: c
The function takes only one argument.

 

 

46. What will be the output of the following Python code?

 

import datetime

d=datetime.date(2016,7,24)

print(d)

a) Error

b) 2017-07-24

c) 2017-7-24

d) 24-7-2017

Check Answer

Answer: b
In the snippet of code shown above, we are simply printing the date entered by us. We enter the date in the format: yyyy,m,dd. The date is then printed in the format: yyyy-mm-dd. Hence the output is: 2017-07-24.

 

47. What will be the output of the following Python code?

import datetime

d=datetime.date(2017,06,18)

print(d)

a) Error

b) 2017-06-18

c) 18-06-2017

d) 06-18-2017

Check Answer

Answer: a
The code shown above will result in an error because of the format of the date entered. Had the date been entered as: d=datetime.date(2017,6,18), no error would have been thrown.

 

48. What will be the output of the following Python code if the system date is 18th August, 2016?

tday=datetime.date.today()

print(tday.month())

a) August

b) Aug

c) 08

d) 8

Check Answer

Answer: d
The code shown above prints the month number from the system date. Therefor the output will be 8 if the system date is 18th August, 2016.

 

49. What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?

import datetime

tday=datetime.date.today()

print(tday)

a) 18-06-2017

b) 06-18-2017

c) 2017-06-18

d) Error

Check Answer

Answer: c
The code shown above prints the system date in the format yyyy-mm-dd. Hence the output of this code is: 2017-06-18.

 

50. What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?

tday=datetime.date.today()

print(tday.weekday())

a) 6

b) 1

c) 0

d) 7

Check Answer

Answer: a
The code shown above prints an integer depending on which day of the week it is. Monday-0, Tuesday-1, Wednesday-2, Thursday-3, Friday-4, Saturday-5, Sunday-6. Hence the output is 6 in the case shown above.

Page  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15      16 

Previous Post

Python MCQ’s on Modules: SET 15

Next Post

Python MCQ’s on Modules: SET 4

Abhishek

Abhishek

Next Post
python

Python MCQ's on Modules: SET 4

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us on Google News
No Result
View All Result

Recent Posts

  • Mustard Oil Price: सस्ता हुआ सरसों का तेल, खरीदने वालों की लगी भीड़
  • Bhojpuri Video: पवन सिंह ने रात के अंधेरे में मोनालिसा के बदन पर फेरा हाथ, मच गया बवाल
  • Gori Nagori ने उछल-उछल कर तोड़ दिया स्टेज, लगाए ताबड़तोड़ ठुमके
  • Haryanvi Dance: भरी जवानी में Gori Nagori के लगाए लटके-झटकें, देख बूढ़ों में आया जोश
  • Gori Nagori ने स्टेज पर उछल उछल कर लगाए जोरदार ठुमके, वायरल हुआ वीडियो

Recent Comments

  • Abhishek on Win 11 Download Links

Archives

  • September 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • August 2022
  • July 2022
  • October 2021
  • July 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • April 2020
  • February 2020

Categories

  • Admit Card
  • Algorithm and Programs
  • Exam
  • Internship
  • Java
  • Jobs
  • latest
  • politics and entertainment
  • Python
  • Result
  • Trademark
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Privacy Policy
  • DMCA
  • Terms of Use
  • Sitemap

© 2020 Getting Placed

No Result
View All Result
  • Home
  • Jobs
  • Exam
  • Admit Card
  • Result
  • Internship

© 2020 Getting Placed

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In