material = input("What material is it? ") length = float(input("What is its length in cm? ")) # Plastic goes into recycling bin. if material == "plastic" == length < 7.5: waste_type = "trash" if material == "plastic" == length > 7.5: waste_type = "recycling" # Anything else goes into trash can. if material != "plastic": waste_type = "trash" # Result.print("Please deposit your item in the " + waste_type + " bin.")
So in this code, I need to classify all plastic with a length of less than 7.5cm as trash. How do I do that? Sorry for bothering y'all but I'm a noob lol.

Larz60+ write Oct-08-2024, 10:32 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added this time. Please use BBCode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added this time. Please use BBCode tags on future posts.