#Filename: Hwk03.py #Author: Molly Killian #Date Created: 2016/09/24 #Purpose: To create our own version of the Deathclock Name = raw_input ("What is your name?>>") Name2 = raw_input("What is your name?>>") AgeYrs = raw_input ('What is your age in years? ') Lifespan = raw_input ('How long do you hope to live in years? ') Agedays = ((int(AgeYrs)) * 365) Remainder = ((int(Lifespan)*365) - (int(Agedays))) Agedays2 = (str(Agedays)) Remainder2 = (str(Remainder)) print Name+Agedays2+Remainder2 # prompt for input on Name, Age in Years, and Expected Lifespan in Years. ## Calculate their age in days, and the number of days they have remaining. ### Write the results to the console in this format: "Name, you are ____ days old. #### You have ___ days left to live." ## except I can't get it to write the results to the console.
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question