Lesson 6 of 34
if மற்றும் else: முடிவெடுத்தல்if and else: Making Decisions
8 min 25 XP
ஒரு condition true ஆக இருந்தால் மட்டும் code-ஐ இயக்க if பயன்படுத்துகிறோம். இல்லையெனில் else பகுதி இயங்கும். Condition-ஐ ( ) brackets உள்ளே எழுத வேண்டும்.
if runs code only when a condition is true; otherwise the else part runs. The condition goes inside ( ) brackets.
Example: edit me and press Run
Press Run to see the result here.ஒப்பீட்டு operators: == சமம், != சமமில்லை, > பெரியது, < சிறியது, >= பெரியது அல்லது சமம், <= சிறியது அல்லது சமம். இவை boolean (true/false) மதிப்பைத் தரும்.
Comparison operators: == equal, != not equal, > greater, < less, >= greater or equal, <= less or equal. Each gives a boolean (true/false).
Example: edit me and press Run
Press Run to see the result here.= மதிப்பைச் சேமிக்கும், == ஒப்பிடும். இதைக் குழப்புவது மிகச் சாதாரண தவறு.
= stores a value, == compares. Mixing them up is one of the most common mistakes.