Lesson 3 of 6

Data Types: எண்கள், எழுத்துகள், True/FalseData Types: Numbers, Text and True/False

8 min 20 XP

Python-ல் ஒவ்வொரு மதிப்புக்கும் ஒரு வகை (type) உண்டு: முழு எண் int, தசம எண் float, எழுத்து str, உண்மை/பொய் bool. type() மூலம் வகையைக் கண்டுபிடிக்கலாம்.

Every value in Python has a type: whole numbers are int, decimals are float, text is str, and True/False is bool. type() tells you the 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() மூலம் எண்ணாக மாற்றுங்கள்.

Careful: "10" is text (a string), while 10 is a number. Adding two strings joins them. To calculate, convert them to numbers with 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 எனப்படும்.

int("5") → 5, float("2.5") → 2.5, str(10) → "10". This is called type conversion.