jeudi 30 avril 2020

If, Elif and Else Format

I'm new to Python and Programming, and would really appreciate your help as I would like to set up an If, Elif and Else statement for the below: An Employee wants to check if they're scheduled to work or if they're on holiday:

I've set it like the below but can't get the response I require, please help. Thanks.

rota = input('Please answer Yes or No - Are you working today? ')
if rota == 'Yes' or 'yes':
    print('Please start your shift, thank you')
elif rota == 'No' or 'no':
    hols = input('Are you on holiday? ')
    if hols == 'Yes' or 'yes':
        print('You do not have a shift as you are on holiday')
    if hols == 'No' or 'no':
        print('Please check your rota for your shift')
    else:
        print('Contact your manager if you require additional information.')

Aucun commentaire:

Enregistrer un commentaire