Lesson 3 of 34

Data Types: ಸಂಖ್ಯೆಗಳು, ಪಠ್ಯ ಮತ್ತು True/False

8 min 20 XP

Python ನಲ್ಲಿ ಪ್ರತಿ ಮೌಲ್ಯಕ್ಕೂ ಒಂದು type ಇದೆ: ಪೂರ್ಣ ಸಂಖ್ಯೆಗಳು int, ದಶಮಾಂಶಗಳು float, ಪಠ್ಯ str, True/False ಎಂದರೆ bool. type() ಆ type ಅನ್ನು ತಿಳಿಸುತ್ತದೆ.

Example: edit me and press Run

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

ಎಚ್ಚರಿಕೆ: "10" ಪಠ್ಯ (string), 10 ಸಂಖ್ಯೆ. ಎರಡು strings ಅನ್ನು ಕೂಡಿಸಿದರೆ ಅವು ಜೋಡಣೆಯಾಗುತ್ತವೆ. ಲೆಕ್ಕ ಹಾಕಲು int() ಬಳಸಿ ಸಂಖ್ಯೆಗಳಾಗಿ ಬದಲಿಸಿ.

Example: edit me and press Run

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

int("5") → 5, float("2.5") → 2.5, str(10) → "10". ಇದನ್ನು type conversion ಎನ್ನುತ್ತಾರೆ.

Challenge

+20 XP

price = "250" ಒಂದು string, qty = 3. ಒಟ್ಟು (price × qty) ಲೆಕ್ಕ ಹಾಕಿ print ಮಾಡಿ. ಸರಿಯಾದ ಉತ್ತರ 750.

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