I'm going through basic pythonprinciples problems, and one of them lists the instructions as:
Write a function named make_day_string that takes an integer named day and returns the string "it is day X of the month" where X is the value of the day parameter.
For example, calling make_day_string(3) should return "it is day 3 of the month".
Remember that to concatenate a string with an integer, you must cast the integer to a string.
Note that the function should return a value. It should not print anything.
My answer is:
def make_day_string(day):
day == str(X)
return ("it is day " + X + " of the month")
print(make_day_string(3)
However, the terminal says
NameError: name 'X' is not defined
I'm confused on how to properly define X in this context, if it's not day == str(X)