Several issues with module 2 question 3

Hi, in module 2, questions 1 and 2 are answered correctly. but I get several error messages on question 3 and I do not know how to fix it:

Failed test case: Variable initialization is not allowed within your solution code. Please remove any variable initializations..
Grader expected: No variable initializations
You got: Variable initialization(s) found: on_hold

Failed test case: Unable to detect valid if statement that checks if the book is overdue.
Grader expected: a valid if statement that checks if the book is overdue
You got: None

Failed test case: Missing printed information.
Grader expected: Book is overdue - Contact Arthur Dent to return it
You got: Missing or incorrect message for book. Please make sure you are using uppercase and lowercase letters where needed. Also, check for typos

Failed test case: Missing printed information.
Grader expected: Book is overdue - Contact Arthur Dent to return it
You got: Missing or incorrect message for book. Please make sure you are using uppercase and lowercase letters where needed. Also, check for typos

Hi @Debby1 ,

It looks like your if statement is not recognised, please check the construction of your if statement and follow the pattern provided in the comments.

Also, for the print statement, make sure there is no space character between print and the open bracket:
print(

there is no space character between print and the (.

Also, I have completed an IF statement for question 2 correctly and this statement follows the same pattern. I have reviewed it over and over and don’t see the mistake

I mean if statement:)

hi @Debby1
It looks like there are many errors. Review whether you have run the previous exercises, as the variables are being used. Then make sure to place each piece of code exactly where the exercise requests it. Do not modify or add anything that is not asked for, stay within the given limits and you should be fine. The error feedback says you are missing a variable, the if statement is not valid, and the book titles may have changed their lowercase and uppercase formatting.

Tip:
Be careful that you are NOT using global variables in the code that you add.

If you’re adding code to a function, you should use the data that is passed to the function as parameters - not use a global variables from a different execution scope.

Hi @Debby1 ,

The test script check the if statement according to its pattern recognition rule. If your if statement is not written correctly, it will fail and therefore, output error as reported - unable to detect valid if statement.

For ex3, you are asked to write a f-string print statement with variable under the if statement, and write a regular strings print statement under the else statement. To include a variable in a print statement using f-string:

print(f"Client name is - {customers[‘name’]}")

here, customers is a dictionary, with name as one of the fields.

Please revisit the video lecture to clarify your understanding.