Need some help with my first code

Hello, I am still a Python rookie. I have just started and am solving my first larger assignment from the course. The assignment is to write a function farm_action that takes the seven factors as arguments in the order they are listed, and returns a single string containing the action(s) the farmer should take. Pretty clear assignment, except I thought I wrote the correct code but now absolutely nothing happens. In previous tests there were few problems. What am I overlooking? My code looks like this:

It would be better to post your code (formatted, of course) rather than an image, but at a quick glance, I can see that you’re not doing anything with the return from your function. One way would be:

action = farm_action('rainy', 'night', False, 'cowshed', 'winter', True, True

print(action)

Thanks for the tip Rob. I will do that from now on. And yes , I see now that I didn’t do anything with the code. The typical beginner’s mistake. Thanks, I can continue.

You’re very welcome Scott.

So called ‘code blind’ is something that many coders experience, not just beginners.

1 Like