Lesson 9 of 34
elif: பல வழிகள்elif: More than Two Choices
8 min 25 XP
இரண்டுக்கு மேற்பட்ட வழிகள் இருந்தால் elif (else if) பயன்படுத்துங்கள். Python மேலிருந்து கீழாகச் சரிபார்த்து, முதலில் True ஆகும் பகுதியை மட்டும் இயக்கும்.
When there are more than two choices, use elif (else if). Python checks from top to bottom and runs only the first part that is True.
Example: edit me and press Run
Press Run to see the result here.வரிசை முக்கியம்! பெரிய எல்லையை (>= 35) முதலில் வையுங்கள். இல்லையெனில் 40 கூட “Warm” என்று வந்துவிடும்.
Order matters! Put the biggest limit (>= 35) first, or 40 would also print “Warm”.
ஒரு கடையில் தள்ளுபடி கணக்கிடும் உதாரணம். Input-ல் வேறு தொகைகளைக் கொடுத்துப் பாருங்கள்.
Here is a shop discount example. Try different amounts in the Input box.
Example: edit me and press Run
Press Run to see the result here.