|
1 | | ---- |
2 | | -tutorial: "https://www.youtube.com/watch?v=Ki1LaUKhPgU" |
3 | | ---- |
| 1 | +# `03` Print more Variables in the console |
4 | 2 |
|
5 | | -# `03` Print the Variables in the console |
6 | | - |
7 | | -You can also use the **print** function to print variables in the console. It's a great way to check their current value, like this: |
| 3 | +You can also print more than one variable in the same `print()` function by separating the variables with a comma `,`. Like this: |
8 | 4 |
|
9 | 5 | ```py
|
10 | | -my_super_variable = 'hello' |
11 | | -print(my_super_variable) |
| 6 | +my_variable = 'hello' |
| 7 | +my_second_variable = "world" |
| 8 | +print(my_variable, my_second_variable) # --> hello world |
12 | 9 | ```
|
13 | 10 |
|
14 | 11 | ## 📝 Instructions:
|
15 | 12 |
|
16 | | -1. Declare a new variable called `color` and assign the value `"red"` to it. |
| 13 | +1. Declare two new variables called `color` and `item`, and assign the value `"red"` and `"marker"` respectively to it. |
17 | 14 |
|
18 | | -2. Then, print its value on the console (you may have to scroll up in the terminal to see it!). |
| 15 | +2. Then, print their values on the console (you may have to scroll up in the terminal to see it!). |
0 commit comments