At the end of the last lesson, you changed the VLAN number in the script.
This number is stored in a variable.In Python, a variable has a name and holds a value.
You create a variable like this:
Figure 1 - = Stores a Value in a Variable
To show the value of a variable on the screen, you use
print()like this:vlan_id = 20 print(vlan_id) # Output: 20In the lab, create a variable named
total_portsthat holds 24.
Print it and click Run to get the flag.Answer the question below
Enter the flag you obtained.
When you write the name of a variable, Python uses its value.
So you can count with variables:
Figure 2 - Python Uses the Value of Each Variable
In the lab, print the number of free ports on SW1 to get the flag.
Answer the question below
Enter the flag you obtained.
A value can also be a text or True or False.
Python calls this the type of the value:
Figure 3 - Three Types of Values
To see the type of a variable, you use
type()insideprint()like this:print(type(total_ports)) # Output: <class 'int'>Python can count with a number but not with a text, even when the text looks like a number:

Figure 4 - Text or Number
In the lab, create a variable named
hostnamethat holds the text "SW1".
Print its type to get the flag.Answer the question below
Enter the flag you obtained.