Lesson 22 of 34

return: జవాబును తిరిగి ఇవ్వడం

8 min 30 XP

print() స్క్రీన్‌పై చూపిస్తుంది మాత్రమే. return పిలిచినవారికి విలువను తిరిగి ఇస్తుంది, కాబట్టి దాన్ని నిల్వ చేయవచ్చు లేదా లెక్కలలో వాడవచ్చు.

Example: edit me and press Run

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

return కి చేరగానే function ఆగిపోతుంది. return లేని function None ఇస్తుంది.

Example: edit me and press Run

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

ఇకపై దాచిన tests మీ function ను వేరే విలువలతో పిలుస్తాయి. కాబట్టి మీ return విలువ సరిగ్గా ఉండాలి!

Challenge

+30 XP

n సరి సంఖ్య అయితే True, కాకపోతే False తిరిగి ఇచ్చే is_even(n) అనే function రాయండి (print కాదు, return!).

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