Lesson 8 of 34

if / else: সিদ্ধান্ত নেওয়া প্রোগ্রাম

8 min 25 XP

if মানে “এটা true হলে এটা করো”। if লাইন : (colon) দিয়ে শেষ হয়, আর তার নিচের লাইনগুলো 4 space ভেতরে থাকে।

Example: edit me and press Run

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

else মানে “নইলে”। Condition False হলে else অংশ চলে। marks 20 করে Run চাপুন।

Example: edit me and press Run

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

ব্যবহারকারী যা টাইপ করে তার ভিত্তিতেও সিদ্ধান্ত নেওয়া যায়। Input box-এ অন্য বয়স দিয়ে Run চাপুন।

Example: edit me and press Run

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

কোন লাইনগুলো if-এর অংশ, Python তা indentation দেখে বোঝে। Tab key ব্যবহার করুন।

Challenge

+25 XP

input() দিয়ে একটি সংখ্যা পড়ুন। জোড় হলে Even, না হলে Odd print করুন।

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