Skip to content

Module 2 challenge: Basic Python Syntax Assessment :Crash Course on Python (Google IT Automation with Python Professional Certificate) Answers 2025

1. Complete the code

✔️

IP_address = "192.168.1.10"
host_name = "Printer Server 1"
print(IP_address + " is the IP address of " + host_name)

2. Value of "big" > "small"

Alphabetically, "b" < "s" → so "big" > "small" is False

✔️ False
❌ True
❌ big
❌ small


3. What is elif used for?

✔️ To handle more than two comparison cases

❌ Mark end of if
❌ Replace “or”
❌ Misspelling


4. exam_grade function

Top Score → score > 95
Pass → score >= 60
Else → Fail

✔️

def exam_grade(score):
if score > 95:
grade = "Top Score"
elif score >= 60:
grade = "Pass"
else:
grade = "Fail"
return grade

5. Code in if block executes only when condition is:

✔️ True

❌ 0
❌ String
❌ False


6. letter_translator function

✔️

def letter_translator(letter):
if letter == "a":
letter_position = 1
elif letter == "b":
letter_position = 2
elif letter == "c":
letter_position = 3
elif letter == "d":
letter_position = 4
else:
letter_position = "unknown"
return letter_position

7. Output of print(sum(sum(1,2), sum(3,4)))

sum(1,2) = 3
sum(3,4) = 7
sum(3,7) = 10

✔️ 10


8. Value of ((10 >= 5*2) and (10 <= 5*2))

5×2 = 10
10 ≥ 10 → True
10 ≤ 10 → True
True and True → True

✔️ True

❌ False
❌ 10
❌ 5*2


9. return_nonnegative function

✔️

def return_nonnegative(first_num, second_num):
if first_num > second_num:
result = first_num - second_num
else:
result = second_num - first_num
return result

10. Benefits of good code style (Select all that apply)

✔️ Easier to maintain
✔️ Makes the intent of the code obvious

❌ Never has to be touched again
❌ Guarantees refactoring later


Summary Table

Q.No Answer
1 IP_address = "192.168.1.10"
host_name = "Printer Server 1"
2 False ✔️
3 To handle more than two comparison cases ✔️
4 score > 95 and score >= 60
5 True ✔️
6 letter == "a", letter == "b", etc., else "unknown"
7 10 ✔️
8 True ✔️
9 Compare numbers and subtract smaller from larger
10 Easier to maintain ✔️, Intent obvious ✔️