0

Intend error

I get the error "the else statement should be intended under if statement" for following code: fruits = ["apple", "cherry", "banana", "kiwi", "lemon", "pear", "peach", "avocado"] num = int(input()) if num > 0 and num < 7: print("Wrong number") else: print(fruits[num]) Please notice that the code from solution looks exactly like mine. Would like to hear your opinion? Thank you

1st Mar 2023, 6:23 PM
Mihai Bacauanu
Mihai Bacauanu - avatar
2 Answers
+ 3
Thank you, it helped me đŸ»
1st Mar 2023, 7:00 PM
Mihai Bacauanu
Mihai Bacauanu - avatar