Lesson 29 of 34

Modules: math, random ಮತ್ತು ಇನ್ನಷ್ಟು

8 min 30 XP

Python ಜೊತೆ ನೂರಾರು ಸಿದ್ಧ modules ಬರುತ್ತವೆ. ಅವನ್ನು import ಮೂಲಕ ಬಳಸಿ. math module ನಲ್ಲಿ ಗಣಿತ functions ಇವೆ.

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

random module games, OTP ಮತ್ತು quizzes ಗೆ ಉಪಯುಕ್ತ. ಪ್ರತಿ ಬಾರಿ Run ಒತ್ತಿದಾಗ ಬೇರೆ ಉತ್ತರ ಸಿಗುತ್ತದೆ!

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

ಬೇಕಾದದ್ದನ್ನು ಮಾತ್ರ ತರಲು from ... import ಬಳಸಿ.

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Challenge

+30 XP

input() ಮೂಲಕ ವೃತ್ತದ ತ್ರಿಜ್ಯ ಓದಿ (ದಶಮಾಂಶವಾಗಿರಬಹುದು). math.pi ಬಳಸಿ ಅದರ ವಿಸ್ತೀರ್ಣ (π × r × r) ಅನ್ನು 2 ದಶಮಾಂಶ ಸ್ಥಾನಗಳಿಗೆ round ಮಾಡಿ print ಮಾಡಿ.

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.