What's wrong with my code? I tried the \b method suggested when I previously asked this question and it still says its w
Posted: Mon Jul 11, 2022 9:56 am
What's wrong with my code? I tried the \b method suggested whenI previously asked this question and it still says its wrong.
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
TEST GREETING def main (): name age born input ( ) int(input()) 2022-int (age) print('Hello', name, '\b! You were born in', born, '\b.') main() Test Amanda_15 Result Input ! Amanda 15 Output < PREV NEXT > Your output: Hello Amanda! You were born in 2007. Expected output: Hello Amanda! You were born in 2007. Error: Wrong Answer
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
TEST GREETING def main (): name age born input ( ) int(input()) 2022-int (age) print('Hello', name, '\b! You were born in', born, '\b.') main() Test Amanda_15 Result Input ! Amanda 15 Output < PREV NEXT > Your output: Hello Amanda! You were born in 2007. Expected output: Hello Amanda! You were born in 2007. Error: Wrong Answer