A
A
AntyBoyKot2021-11-11 22:15:19
Python
AntyBoyKot, 2021-11-11 22:15:19

Why doesn't this code work in Python?

This code does not work in Python:

money = 600
if money >= 100 and <= 500:
      print('Yes!').

What to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2021-11-11
@AntyBoyKot

What to do? Yes, you can't do that. The second page of any textbook. You need to explicitly state that if money is greater than or equal to 100 and money is less than or equal to 500!

money = 600
if money >= 100 and money<= 500:
    print('Yes!')

S
Sergey Gornostaev, 2021-11-11
@sergey-gornostaev

Read textbook.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question