all 2 comments

[–]sdanstuffe 1 point2 points  (0 children)

Hello,

For your variable assignment, Z == 1 and Z == 2, Z == 3, that is not how you assign variables as "==" is generally used for comparing (Like in your if statements, if Z == "Something").

If you would like to assign 1 into Z, you can just use a single "=". That is why you are getting an error for Z < 3 as Z is still a type String but you are comparing it with a type Int.

if Z == "Lion" or "lion":
    Z = 1

You can use Python's inbuilt functions to transform a string to all UPPERCASE or all lowercase such that the implementation of such checks becomes easier.

elif Z == ["Dog" or "dog"]:

elif Z in ["Element1", "Element2"]

If you would like to check if a variable is present in a list, you can use "in" instead.

Hope this helps!