News Report Generation

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")

1 thought on “News Report Generation”

  1. Pretty nice post. I just stumbled upon your weblog and wanted to say that I have truly enjoyed browsing your blog posts.
    In any case I’ll be subscribing to your rss feed and I hope you
    write again soon!

Leave a Comment

Your email address will not be published. Required fields are marked *