Python Forum
beginner and need help with python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
beginner and need help with python
#13
you can specify a condition only with if and elif
if i == 6:
   print("we have 6 juice")
elif i == 0:
   print("we have no juice")
elif i == 1 or i == 2:
   print("you have 1 or 2 juice")
else:
   print("we have enough of juice")
The elif statement allows you to check multiple expressions.
An else statement contains the block of code that executes if and elif conditional expression in the if statement resolves to 0 or a FALSE value.
Reply


Messages In This Thread
beginner and need help with python - by Tjay - Oct-13-2019, 07:35 PM
RE: beginner and need help with python - by buran - Oct-14-2019, 05:54 AM
RE: beginner and need help with python - by Tjay - Oct-14-2019, 05:44 PM
RE: beginner and need help with python - by Tjay - Oct-14-2019, 07:06 PM
RE: beginner and need help with python - by Tjay - Oct-14-2019, 07:23 PM
RE: beginner and need help with python - by buran - Oct-14-2019, 07:37 PM
RE: beginner and need help with python - by Tjay - Oct-14-2019, 07:50 PM
RE: beginner and need help with python - by DZ_Galaxy - Oct-15-2019, 04:03 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020