I am completely new to Python, just learning strings and variables at the moment. I know you can put a "#" before code to comment it, but is there an option for Python to completely ignore part of the code and start working from the lines after this code?
For example:
old_price = 30
new_price = 25
difference = old_price - new_price
name = "John Smith"
age = 15
print(name, age)
I would like the code to start working from the line name="John Smith", without having to comment the first 3 lines.
You can use multiline strings to comment the whole block, not having to put # in each line:
"""
old_price = 30
new_price = 25
difference = old_price - new_price
"""
name = "John Smith"
age = 15
print(name, age)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With