INTRO: Writing Our First Code Flashcards
Do all coding languages have the same syntax for displaying something on the screen?
Every language has a different syntax for displaying or printing something on the screen.
What’s a terminal?
A terminal is the screen where we see the code or the output of our program.
What’s an output of a program?
- The action of showing the product or result of a code after it is executed or run.
- It refers to the information or results that the program produces or generates when it is executed or run.
Can we print multiple pieces of Data in a single print command?
Yes, we just have to separate them using commas.
print(50, 1000, 3.142, “Hello World”)
Why is the text “Hello World” bounded by quotation marks?
Because it is a string or a group of characters.
By default, each print statement prints text where?
On the next line
If we want multiple print statements to print on the SAME LINE, what do we do?
print(“Hello”, end=””)
print(“World”)
print(“Hello”, end=” “)
print(“World”)
HelloWorld
Hello World
What’s the purpose of the code with end=” “
The purpose of end=” “ is to
- print (add) different characters or values
at the end of the first print statement. - we want multiple print statements to
print on the SAME LINE.
print(“Hello”, end=” “)
print(“World”)
Hello World
What’s the purpose of comments?
Comments are pieces of text used to:
- make computers ignore certain parts of the program
-DESCRIBE WHAT’S HAPPENING in the code.
-They have no effect on the code whatsoever.
print(50) # This line prints 50
print(“Hello World”) # This line prints Hello World
Is Python a general-purpose programming language?
-Yes, Python is designed to be :
-flexible and versatile,
-capable of solving a wide range of problems
-across various domains and industries.
What the versatility of Python means?
It means, it can be applied
-to various tasks, domains, and industries
-due to its extensive ecosystem, adaptability, flexibility and ease of use.
Valiable and value
age = 25 - the age variable is created and it’s storing 25
print(age) - prints the value stored in the age variable