Python Forum
Selection based of variables issue
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selection based of variables issue
#2
You have the if structure backwards. If the character is not in the first if clause then its not going to be in any of the other ones either because the first one has all of the options listed in it from the elif's. So it will either execute the first if clause or the else clause, but never the elif's.

also there is no point in checking it twice. So if you started the if structure with:
if '=' not in year:
Then the second one
elif '=' not in month:
because it would not be in year and month if it is not in year. So thus you only have to check for month.
Recommended Tutorials:
Reply


Messages In This Thread
Selection based of variables issue - by nikos - Feb-02-2019, 01:57 PM
RE: Selection based of variables issue - by metulburr - Feb-02-2019, 02:46 PM
RE: Selection based of variables issue - by nikos - Feb-02-2019, 02:53 PM
RE: Selection based of variables issue - by nikos - Feb-02-2019, 03:17 PM
RE: Selection based of variables issue - by nikos - Feb-03-2019, 08:04 PM
RE: Selection based of variables issue - by nikos - Feb-04-2019, 02:22 PM
RE: Selection based of variables issue - by nikos - Feb-04-2019, 11:00 PM
RE: Selection based of variables issue - by nikos - Feb-06-2019, 01:42 PM
RE: Selection based of variables issue - by nikos - Feb-07-2019, 09:48 AM
RE: Selection based of variables issue - by nikos - Feb-07-2019, 01:40 PM
RE: Selection based of variables issue - by nikos - Feb-07-2019, 06:39 PM
RE: Selection based of variables issue - by nikos - Feb-09-2019, 08:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  generate random variables based on a non-standard t-distribution nathalie 4 3,541 Dec-03-2019, 12:11 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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