Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Functions | Python Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Python Fundamentals

Lesson 9 of 55

·Python

Functions

20 minutes

Course progress16%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • Declare a function with `def name(params):`.
  • Use `return` to send a result back to the caller.
  • Functions promote code reuse and improve readability.

Functions

Functions are reusable blocks of code that you can call with arguments. Define a function using the def keyword followed by a name and optional parameters.

def greet(name):
    return f'Hello, {name}!'

print(greet('Bob'))

A return statement sends a value back to the caller. If a function reaches the end without return, it implicitly returns None.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Python FundamentalsBrowse activities
Previous lessonLoops – ForContinue to lesson 10Arguments and Return ValuesBack to Python Fundamentals curriculum