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

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Python Fundamentals

Lesson 9 of 55 · Python

Functions

Duration: 20 minutes

Functions\n\nFunctions 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.\n\npython\ndef greet(name):\n return f'Hello, {name}!'\n\nprint(greet('Bob'))\n\n\nA return statement sends a value back to the caller. If a function reaches the end without return, it implicitly returns None.\n

Previous: Loops – ForNext: Arguments and Return Values