You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB
Python

# Activity Solution:
# 1. In the s01 folder, create an "activity" folder, and inside it, create an "activity.py" file.
# 2. Create 5 variables and display them in the terminal using the following format:
# "I am `<name (string)>`, and I am `<age (integer)>` years old, I work as a `<occupation (string)>`, and my rating for `<movie (string)>` is `<rating (decimal)>`%."
name = "Jose"
age = 38
occupation = "writer"
movie = "One more chance"
rating = 99.6
print(f"I am {name}, and I am {age} years old, I work as a {occupation}, and my rating for {movie} is {rating}%.")
# 3. Create 3 variables named num1, num2, and num3.
num1 = 10
num2 = 15
num3 = 12
# Print the product of num1 and num2.
print(num1 * num2)
# Print whether num1 is less than num3.
print(num1 < num3)
# Add the value of num3 to num2, then print the updated value of num2.
num2 += num3
print(num2)
# 4. Update your local session Git repository and push to Git with the commit message "Add activity code s01".
# 5. Add the repository link in Boodle for s01.