Lesson 10 of 34

and, or, not: நிபந்தனைகளை இணைப்பதுand, or, not: Combining Conditions

8 min 25 XP

and: இரண்டும் True ஆனால் மட்டுமே True. or: ஏதாவது ஒன்று True ஆனால் போதும். not: True-ஐ False ஆகவும், False-ஐ True ஆகவும் மாற்றும்.

and: True only if both sides are True. or: True if at least one side is True. not: flips True to False and False to True.

Example: edit me and press Run

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

நிஜ உதாரணம்: வேலைக்குத் தகுதி பெற degree வேண்டும், மேலும் 60% அல்லது அதற்கு மேல் மதிப்பெண் வேண்டும்.

A real example: to be eligible for a job, you need a degree and at least 60% marks.

Example: edit me and press Run

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

ஒரு எண் ஒரு வரம்புக்குள் உள்ளதா என்று பார்க்க Python-ல் சுருக்கமாக எழுதலாம்: 18 <= age <= 60

Python has a shortcut to check a range: 18 <= age <= 60

Challenge

+25 XP

ஒரு ஆண்டை (year) input() மூலம் பெறுங்கள். அது லீப் ஆண்டு (leap year) என்றால் Yes, இல்லையெனில் No என்று print செய்யுங்கள். விதி: 4-ஆல் வகுபடும் ஆனால் 100-ஆல் வகுபடாது, அல்லது 400-ஆல் வகுபடும்.

Read a year with input(). Print Yes if it is a leap year, otherwise No. Rule: divisible by 4 but not by 100, or divisible by 400.

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