News Report Generation
Japan was hit by a huge Tsunami. Lives and properties were lost. Many were injured too. A news reporter has arrived to the spot to analyse and generate report on the number of people alive , dead and injured. His report also has a statement seeking public to help the people in need. Can you help him to generate the report by writing a Python program ?
Note:
- If the dead count or injured count or safe count entered by the user is a negative number, then display the message “Invalid input” and stop the program.
- The statement for seeking help should be “Please help the people who are suffering!!!”.
- Please refer the sample input and output for more clarifications.
Sample Input 1:
Dead Count:
2000
Injured Count:
3000
Safe Count:
10000
Sample Output 1:
TSUNAMI REPORT OF JAPAN
The number of people
Dead:2000
Injured:3000
Safe:10000
Please help the people who are suffering!!!
Sample Input 2:
Dead Count:
-2000
Sample Output 2:
Invalid input
Code :-
x=int(input("Dead Count:"+"\n")) if x>=0: y=int(input("Injured Count:"+"\n")) if y>=0: z=int(input("Safe Count:"+"\n")) if z>=0: print("TSUNAMI REPORT OF JAPAN"+"\n"+"The number of people"+"\n"+"Dead:"+str(x)+"\n"+"Injured:"+str(y)+"\n"+ "Safe:"+str(z)+"\n"+"Please help the people who are suffering!!!") else: print("Invalid input") else: print("Invalid input") else: print("Invalid input")