Lesson 21 of 34

Functions: మీ సొంత commands

8 min 25 XP

ఒకే కోడ్‌ను మళ్ళీ మళ్ళీ రాస్తున్నారా? దాన్ని function గా చేయండి. def తో మొదలుపెట్టి, పేరు, ( ), : రాసి, లోపలి కోడ్‌ను indent చేయండి.

Example: edit me and press Run

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

Parameters ను ( ) లోపల ఉంచండి. function ను పిలిచేటప్పుడు ఇచ్చే విలువలు (arguments) వాటిలోకి వస్తాయి.

Example: edit me and press Run

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

function ను నిర్వచించడం (def) దాన్ని నడపదు. దాన్ని పిలవాలి: greet(...)

Challenge

+25 XP

"Vanakkam, <name>!" అని print చేసే greet(name) అనే function రాయండి. తర్వాత greet("Arun"), greet("Priya") పిలవండి.

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