Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If then statement help
#1
I am new to coding and trying to figure out a way to code in python for a decision tree that is long and complicated. It is the logic behind a webform. My wordpress developer is having trouble but says if I get it in python code she could use it. The meat of the project will be rules that govern what pages are show to the user based upon two age categories.

There is, though, some "weeding out" before I get to those two rules, and I have used a flow chart on that weeding out process. I was hoping someone could just get me started with a basic structure Shy

Thanks for much!!
Reply
#2
print('How old are you, you old f***?')
get_old_codger_age = int(input('Come on Methusela, tell us your real age ... '))
print('What\'s your RFC old fella? What? You don\'t know what an RFC is? Jesus, these old folks ... ')
RFC = int(input('RFC please ... '))
print('Give us your ALLPRWExertional level, if you can read this. Found your specs yet?')
ALLPRWEL = int(input('Come on, out with it! Ever exerted yourself?? ... '))
print('If you are still awake Grandad, we need your, and don\'t even think about asking me, ALL PRW Skill Level ... ')
ALLPRWSL = int(input('Come on, cough it up you Neanderthal ... '))
print('Still awake Ancient One? We also need your RFC Skill Level, be quick about it, I haven\'t got all day!')
RFCSL = int(input('Any skill at all, nearly rotting corpse??'))
print('Hang on and don\'t die whilst we do some quick calculations ... ')

if get_old_codger_age < 50 or RFC =< 3:
    hyperlink = 'land_of_the_young_and_brave.php'
elif ALLPRWEL - RFC => 0 and  ALLPRWSL - RFCSL =< 0:
    hyperlink = 'RTS_form.php'
elif ALLPRWEL - RFC =< 0 and  ALLPRWSL - RFCSL => 0 and get_old_codger_age => 50 and get_old_codger_age =< 55:
    hyperlink = 'not_quite_dead_form.php'
else:
    hyperlink = 'teetering_on_the_brink_form.php'
    print('Don\'t forget to add us to your will, sweet old man, we love you ... ')
Reply


Forum Jump:

User Panel Messages

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