Unit 1 · What is Python?! · Lesson 6 of 57
Magic? I think not!
What just happened?
Congrats on making your first Python program! Now you have to understand how it works.
When we ran print("Hello World!"), we managed to output text to the console. This was done by calling the print function, with the argument "Hello World!".
If I were to say this in English, here's what we did:
- We told Python that we wanted to
printsomething to the console - We used
(to tell Python that we were going to give it more details about this use ofprint - We then used
"Hello World!"to say exactly what we wanted to print - We used
)to tell Python that we were done giving it more details about this use ofprint
Did I lose you? If I did, here's an even easier explanation:
I want you to print "Hello World!" into the terminal.
Does it make sense? We just use the parentheses to make it even easier for Python to understand what we're saying.
Alter your program to say Goodbye World! instead. (Don't forget the quotes!)
Python exercise
Write the program in an editor next to the lesson, run it, and have it checked automatically. Create a free account to do this part.
Do this lesson for real
With a free account you get the terminals, challenges and checks that go with the lessons in Intro to Python, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.