Lesson 11 of 34
if-க்குள் if: Nested Conditionsif inside if: Nested Conditions
8 min 30 XP
சில நேரங்களில் முதல் கேள்விக்குப் பதில் கிடைத்த பிறகுதான் அடுத்த கேள்வி கேட்க முடியும். அப்போது ஒரு if-க்குள் இன்னொரு if எழுதலாம். உள்ளே உள்ள if இன்னும் 4 spaces தள்ளி இருக்கும்.
Sometimes you can only ask the second question after the first one is answered. Then you write an if inside another if, indented 4 more spaces.
Example: edit me and press Run
Press Run to see the result here.எந்த else எந்த if-க்குச் சொந்தம் என்பதை indentation தீர்மானிக்கிறது. ஒவ்வொரு if-ம் அதன் else-ம் ஒரே நேர்கோட்டில் இருக்க வேண்டும்.
Indentation decides which else belongs to which if. Each if and its else must line up.