Lesson 13
Creating Functions
Organize code using functions
1What is a Function?✨
A reusable block of code that does one job.
2Simple Function🎯
💻 code
def greet():
print("Hello!")💻 code
greet() # Call the function3Functions with Parameters💡
💻 code
def greet(name):
print(f"Hello, {name}!")💻 code
greet("Alice")4Functions with Return🚀
💻 code
def add(a, b):
return a + b💻 code
result = add(5, 3) # result = 85Multiple Parameters🔍
💻 code
def calculate_total(price, tax_rate):
tax = price * tax_rate
return price + tax💻 code
total = calculate_total(100, 0.08) # 1086Real Examples⭐
💻 code
def check_grade(score):
if score >= 90:
return "A"
elif score >= 80:
return "B"
else:
return "C"💻 code
grade = check_grade(95) # "A"💻 code
def area_of_circle(radius):
return 3.14 * radius * radius🎯 Practice Challenges
Master Creating Functions by completing all 3 difficulty levels
🟢 EASY
Creating Functions - Easy Challenge
Start with the basics. Perfect for beginners!
🟡 MEDIUM
Creating Functions - Medium Challenge
Get more challenging. Build your confidence!
🔴 HARD
Creating Functions - Hard Challenge
Master this concept. Prove your skills!
🏆 Study a lesson for 2+ minutes to earn +10 TalentJR Points a day. Badges, certificates & prizes →
Ready to Master Creating Functions? 🚀
Complete the challenges, take the quiz and keep your learning streak going!
Keep learning
- ← Previous lessonLesson 12: Data Processing BasicsCollect and process data effectively
- Next lesson →Lesson 14: Advanced FunctionsMaster function techniques
- Grade 6 coursePython Control FlowPython coding course for kids.
- Student ToolsFree calculators for studentsPercentage, fraction, ratio and marks calculators with steps.
- CBSEClass 5 CBSE & NCERT study materialMaths, Science and Computer chapters with solutions.
- Future SkillsExplore future skillsAI, robotics and new-age skills explained for students.