Lesson 11 of 34

if-এর ভেতরে if: Nested Conditions

8 min 30 XP

কখনো প্রথম প্রশ্নের উত্তর পাওয়ার পরেই দ্বিতীয় প্রশ্ন করা যায়। তখন একটি if-এর ভেতরে আরেকটি if লেখা হয়, আরও 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 কোন if-এর, তা indentation ঠিক করে। প্রতিটি if আর তার else এক লাইনে মিলতে হবে।

Challenge

+30 XP

একটি সাধারণ login প্রোগ্রাম। input() দিয়ে username, তারপর password পড়ুন। username "admin" না হলে → Unknown user "admin" এবং password "1234" হলে → Welcome "admin" কিন্তু password ভুল হলে → Wrong password

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