From the course: Introduction to Career Skills in Software Development

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Saving data with Python

Saving data with Python

- [Instructor] We declare variables in Python by giving them a name and then setting their value. This assignment is done with the equal sign. Let's create some variables so you can see how it's done. The first variable we'll create will be a number representing a score. We'll write the word score, then a space, an equal sign, another space, and then the number 750. What did we just do? Score is the name of our variable. And because of the equal sign, we are assigning it the value of 750. This means that somewhere in the computer's memory, it has made space for our variable and stored our value. Let's see what happens when we ask the computer to print out what's in the score variable. To do that, we'll use our familiar print command, and we'll provide score as its input inside the parentheses. So we'll come underneath score, we'll type print, open parenthesis, and then score. Let's click Run. And we get 750 as the…

Contents