<em>Questions:</em>
<em>CS Code Practice 1.8 Question 1:</em>
<em>Write a code that accepts the user's age as an input, then print their age in 10 years.</em>
<em></em>
<em>CS Code Practice 1.8 Question 2:</em>
<em>Write a code that accepts a whole number as an input, subtracts 5 and print the answer</em>
<em></em>
Answer:
Question 1:
currentage = int(input("Enter your age: "))
print("Your age in 10 years is "+str(currentage + 10))
Question 2:
userinput = int(input("Enter a whole number: "))
print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))
Explanation:
There are two questions in this category and I don't know which of them you need; So, I answered both.
Question 1:
This line prompts user for age
currentage = int(input("Enter your age: "))
This line adds 10 to user input and prints the result
print("Your age in 10 years is "+str(currentage + 10))
Question 2:
This line prompts user for a whole number
userinput = int(input("Enter a whole number: "))
This line subtracts 5 from the whole number and prints the result
print(str(userinput)+" - "+str(5)+" = "+str(userinput - 5))