Python foundations
Your friendly Python tutor for the Lesson Core demo.
Meet Ada (demo)
Ada (demo)
Your friendly Python tutor for the Lesson Core demo.
1 unit · 2 lessons
What’s inside
Getting started
- Variables & functions
1 phase · 1 unit · 2 lessons
Questions about this course
what is a variable in python
A variable is a name you attach to a value so you can reuse it later, like storing a number or a piece of text and referring to it by that name. You create one just by writing the name, an equals sign, and the value. This course starts here, showing how to assign and update variables from your very first lines of code.
how do you write a function in python
You define a function with the def keyword, give it a name, list any inputs in parentheses, and write the steps it should run underneath. Once defined, you can call it as many times as you like instead of repeating the same code. Building and calling your own simple functions is a core skill practised here.
difference between defining and calling a function
Defining a function describes what it should do but doesn't run it; calling the function is what actually makes it execute, using the name followed by parentheses. You can define once and call it many times with different inputs. The course walks through both sides so the distinction is clear early on.
how to get started coding in python with no experience
Begin small: write a line that stores a value, print it out, and celebrate when it works before moving to the next idea. From there you build up to grouping steps into functions you can reuse. This course is built for exactly that first-steps stage, keeping each new concept to a single working line at a time.
how do you pass information into a function
You pass information through parameters listed in the function's parentheses, and supply the actual values, called arguments, when you call it. Inside the function those values behave like variables you can work with. Connecting variables and functions this way is one of the main things practised in this course.