Python if statement error

Asked 2 years ago, Updated 2 years ago, 12 views

It is a problem that outputs only the first input of a to the first input of z from any string. There is a condition that a and z must be included and a must come before z. I don't know why I get that = errorㅠ<

python

2022-09-21 19:34

1 Answers

In Python, it is not || but or

&& is and

And I think the last line is not print x['a':'z'] but print x[q:p]


2022-09-21 19:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.