Python Program to Check the eligibility criteria for donor

 

Python Comparison Operators

An XYZ hospital has organised a blood donation camp. The eligibility criteria for donor was as follows 

1) Age>=18 

2) Weight >=50 kg 

3) No disease 

Rakesh went for the blood donation. He filled out the form and submitted it to the nurse. 

Check whether Rakesh will be allowed or not. 

Input 

First line of input is age in float 

Second line of input is weight in float 

Third line of input is 1 or 0 

1 is for True and 0 is for False 

Output 

If all the condition in the eligibility are satisfied then allowed to donate. 

Example 

Input 1 

19.5 

52.6 

Output 1 

True 

Input 2 

51.6 

68 

Output 2 

False

Code:

age=float(input())
weight=float(input())
noDisease=int(input())
if age>=18 and weight>=50 and noDisease==1:
    print(True)
else:
    print(False)

Comments

Popular posts from this blog

CODING ASSIGNMENT 4

CODING PRACTICE 11 Music Page

CCBP Static Website Coding Assignment 2 Solution | Yoga Page