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 হলো সংখ্যা। দুটি string যোগ করলে তারা জুড়ে যায়। হিসাব করতে 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.