nael Posted April 23, 2021 Share Posted April 23, 2021 if 5 > 2: print("Five is greater than two!") elif (6 > 3): print("Six is greater than three!") hi everyone, i want to ask. Why conditional elif do not appear? Link to comment Share on other sites More sharing options...
Ingolme Posted April 23, 2021 Share Posted April 23, 2021 The second condition only gets tested if the first one was false. Since 5 is actually greater than 2, it does not need to go on and test the second condition. If you want both conditions to be tested, you do not need the elif() statement. A second if() will do the job. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now