Join Joe Marini for an in-depth discussion in this video Python functions, part of Up and Running with Python.
Most applications whether their written in Python, or some other programming…language, are broken up into smaller blocks known as functions and Python's is…no different. So in this example we're going to take a…look at how to work with functions in Python.…So I'm going to go over here under Chapter 2, and open up functions_start.py, this is…the example file for this part of the course.…Back over here in my example snippets text, I'm going to copy lines 49 through…51, and paste them in. Now if you've been following along the…course so far you've already seen me do something like this, I'm just defining the function.…
Functions are defined with the def keyword and then they're given a name.…And then open and close parens. Now this function doesn't take any…arguments, but we'll get to that in a little bit.…And then a colon. The colon indicates that you're starting…the scope of a function. And so you can see down here that line…number 7 is indented in to two spaces. And it's up to you how many times you want…
- Installing Python
- Choosing an editor/IDE
- Working with variables and expressions
- Writing loops
- Using the date, time, and datetime classes
- Reading and writing files
- Fetching Internet data
- Parsing and processing HTML
Skill Level Beginner
1. Preparing the Development Environment
2. Python Basics
3. Working with Dates and Times
4. Working with Files
5. Working with Web Data
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.