WEEK9 (1) Lab Questions and Answers
WEEK9 (1) Lab Questions and Answers
Computer
Science?
You have two problems you have to solve at the same time.
➢ You have to learn about problem solving and how to put it down on
computer.
“Hey, I’ll just write a program for that”. For us, that is “computational
thinking”
We recommend that you install the Anaconda Python 3.11 distribution using
the instructions found at the following link: Anaconda Python
Spyder IDE
.
.
This Photo by Unknown Author is
licensed under CC BY-SA-NC .
Editor Window:
Console Window:
# Display a message
print("Welcome to Python")
They are ignored by the Python interpreter (i.e. They are not
executed.)
# Display two messages
print("Welcome to Python")
print("Python is fun")
"""
This is a
multiple line comment
"""
CS121 - Introduction to Computer Applications and Programming
21
More Examples of the print
Function
Printing numerical values
print(3 + 4)
◦ Evaluates the expression 3 + 4 and displays 7
By default the print function starts a new line after its arguments are printed
print("Hello")
print("World!")
◦ Prints two lines of text:
Hello
World!
my_int = my_int + 7
lhs = rhs
What assignment means is: