Week 5 - BALT 4396B - CH 1 to 4

Ch2 Print Statement and Comments


Chapter 1-4 of Professor Kelsey's book; Learning Python with ChatGPT and Google Colab, gives us a quick summary of what Python is and how to open/use it.  It touches on basic concepts like on Chapter 2 which focuses on Print Statements and Comments. Chapter 3 teaches us about Indentations. Chapter 4 is Understanding variables. All of these concepts get tied up together. The more important one to learn out of these may be the variables. If we can't read the information on a notebook, then learning everything else wouldn't be useful. On this certain blog I will be summarizing Chapter 2. Speaking on what Print Statement is and how to leave comments.

In Chapter 2 we are introduced to "Hello World. Users of Python usually start out with this first. It can be used as an exercise and to test out the program. You can look at the different outcomes and compare. The print function puts out whatever you put into the system. You can type in a code, click run, and it will give you that outcome. You can go back and check if you plugged in the correct code/prompt/script. We also get an introduction to comments. Comments in Python are lines of text that can be used to describe the codes and what they're doing. Other users/creators that are looking at your notebook can understand your work a lot better by reading the comments. Python allows us to write comments in two different ways. There are single-line comments, and multi-line comments.

How to Print and Run a code on Python 
1. Open Google Colab on your browser.
- This is the link https://colab.research.google.com/
2. Once you are on Google Colab click on the "File Menu" (top left corner) then click "New Notebook" this opens up a new notebook.
3. Click the cell in your new notebook 
4. Type the code provided in the cell:
- print("Hello, World!")
5. Run the code by pressing "Shift + Enter" on your devices keyboard or press the play button.
- This will run the code and provide us with its output.

Comments
Example of Single-Line Comment: 
Single-line comments stars with #
# This is a single-line comment print("Hello, World!") # This comment is on the
same line as the code

Example of Multi- Line Comment: 
Multi-line comments start with ' ' '  or " " "
''' This is a multi-line comment. It can span multiple lines. ''' print("Hello,
World!")


Comments