Ask Question
13 September, 20:39

Type two statements.

The first reads user input into person_name. The second reads user input into person_age. Use the int () function to convert person_age into an integer. Note: Do not write a prompt for the input values.

Below is a sample output for the given program if the user's input is: Amy 4

Output: In 5 years Amy will be 9

+4
Answers (1)
  1. 13 September, 22:11
    0
    Following are the program in Python langauge

    person_name = input () # Read the person name by the user

    person_age=0 #declared a vaiable person_age

    person_age = int (input ()) # read person_age by the user

    person_age=person_age+5 # add 5 to person_age

    print ('In 5 years', person_name,'will be', person_age) # display the output

    Output:

    Amy

    4

    In 5 years Amy will be 9

    Explanation:

    Following is the description of code:

    Read the value of the "person_name" variable by the user by using the input function. Declared a variable person_age and initialized 0 with them. Read the value of "person_age" variable by user by using input function and convert into int by using int function Add 5 to "person_age" variable and store again them into the "person_age" variable. Finally, display the output which is mention in the question.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Type two statements. The first reads user input into person_name. The second reads user input into person_age. Use the int () function to ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers