In this practice, we will be reviewing some basic concepts of Python and writing code!
Contents on this post
Python's must-knows
Hello World
print function
Comments
What is Python?
Python is a programming language, that is distinguished by its simplicity and how easy it is to learn and understand it and can be executed in any type of OS. It was created at the beginning of the 90s and right now it´s on its third version.
Things you work on with Python
Artificial Intelligence
Big Data
Machine Learning
Data Science
App Development
First Program! Hello World!
Hello World! Whenever you are starting on a new programming language, the most accurate way to start is just by making the console show something, usually, for educational uses, the "Hello World!" is used. Even, if you want to start on a new language just search on your browser the hello world on the language you´d like to learn, for example on Python you would search "Python hello world" and it will show you how to get started on the language.
Code
print("Hello World!")
Parts of the code!
print(): print is a Python function, its function is to show on the screen what´s written in the parenthesis that follows the print function.
Quotation marks: They´re used because we are telling the program that what we are going to print is a text.
Text: The text can be whatever the coder wants, meanwhile it´s between the quotation marks.
Output
Hello World!
Comments
Comments on programming are used to show the reader what the code is about, that way it can be easier to understand, but it won´t affect nor display the code itself.
On Python, comments are made by putting a hashtag at the beginning of the comment.
Code
#Show a Hello sign
print("Hello")
Output
Hello
As you can see the comment isn't shown on the console because it doesn't affect the output or the code, they are just used aesthetically
Practice!
-Write a program that shows your name on the console
-Write a program that shows your favorite color on the console
Change a couple of times what can you print in the console, try different things, if Python outputs an error, google it and find out how to fix it!
Comentarios