Page 1 of 1

What's wrong with my code? (Python)

Posted: Sun Jul 10, 2022 11:27 am
by answerhappygod
What's wrong with my code? (Python)
What S Wrong With My Code Python 1
What S Wrong With My Code Python 1 (53.76 KiB) Viewed 55 times
What S Wrong With My Code Python 2
What S Wrong With My Code Python 2 (35.02 KiB) Viewed 55 times
In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold: What is your name? Amanda How old are you? 15 Hello Amanda! You were born in 2005. 1. Write the program. Format your code using best practices. Refer to the zyBooks style guide, if needed, to use proper naming conventions for variables and methods. Use the most appropriate statements with minimal extraneous elements, steps, or procedures. 2. Run the program. 3. Debug the program. Be sure your code produces the correct results. 4. Save and submit your file.
def main (): name=input('What age int(input('How born 2022-int (age) print('Hello', name,'! You were born in', born,'.') main () Test Amanda_15 is your name?') old are you? ยน)) Result Input 0 Amanda 15 Output Your output: What is your name? How old are you? Hello Amanda! You were born in 2007. Expected output: Hello Amanda! You were born in 2007. Error: Wrong Answer