From the course: Programming Foundations: Beyond the Fundamentals
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Working with a module - Python Tutorial
From the course: Programming Foundations: Beyond the Fundamentals
Working with a module
- When the application you're working on becomes large and complex, it's common to split your code into different modules as a way of organizing it. You can use modules shared by other developers, but you can also create your own. Let's try it out. In the start files for this video, I have a file called testmodule.py. This file contains a function called mult that accepts two numbers, and then prints the result of multiplying them. This is something I might find useful in a lot of different programs I write, so splitting it out into a module makes it easier for me to integrate it into different applications I create. You might notice here that I'm using a Python syntax to print a combination of strings and variable values, starting with the letter F. You can learn more about that by looking at Python documentation online. The app.py file is blank. This file is where I'm going to write the main code for my…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.