0% found this document useful (0 votes)
34 views1 page

Practice Exercises: Programming Foundations: Fundamentals

Exercises

Uploaded by

abhi74
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Practice Exercises: Programming Foundations: Fundamentals

Exercises

Uploaded by

abhi74
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming Foundations: Fundamentals

with Annyce Davis

Practice Exercises
Here are a few small programs to help you understand the output of different lines of code.

1. What’s the output of the following program?


print(“Practice Exercise 1:”)

# A message for the user


message = “This is going to be tricky. ;)”
Message = “Very tricky!”
print(Message)

# Perform mathematical operations


result = 2**3
print(“2**3 =”, result)
result = 5 - 3
print(“5 - 3 =”, result)

2. What’s the output of the following program?


print(“Practice Exercise 2:”)

message = “Hope you’re having fun!”


print(“The message”, message)

# Perform mathematical operations


answer = 5+2**3
print(“the answer is:”, answer)

result = 5 - 3
#print(“5 - 3 =”, result)

print(“Done!”)

Programming Foundations: Fundamentals with Annyce Davis 1 of 1

You might also like