From the course: Programming Foundations: Fundamentals
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Working with comments - Python Tutorial
From the course: Programming Foundations: Fundamentals
Working with comments
- Comments are notes to your future self and others to describe what your code does. Right now, we have small programs. We can keep the flow of it all in our heads, but over time as you continue to grow your programming skills, you'll be writing much longer programs. Some may even be thousands of lines of code spread over dozens of files. It would be impossible to keep all of that in your head. By adding comments to your code, you can document the purpose of the different variables, functions, and classes. You can think of them as virtual sticky notes. Here we are with our program that asks the user for their name and also asks if they're enjoying the course. Comments are started with hash marks. Let's add our very first comment here on line number one. We'll type the hash mark and then a space and type greet the user. Notice how the entire line is now colored green. This is how the IDE is letting us know that this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Introduction to variables and data types3m 37s
-
(Locked)
Variables across languages3m 27s
-
(Locked)
Working with numbers4m 48s
-
(Locked)
Working with strings2m 29s
-
(Locked)
Properly using whitespace4m 22s
-
(Locked)
Working with comments3m 26s
-
(Locked)
Challenge: What's the output?49s
-
(Locked)
Solution: What's the output?5m 14s
-
-
-
-
-