Ask Question
18 September, 00:22

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

+2
Answers (1)
  1. 18 September, 00:37
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers