30 Oct TCMS 18:30 Python Homework 10.25
Question 1.
Write a program that asks for your name, then asks for your age, then prints a message with your name and age in it.
Input example:
What is your name? Kevin
What is your age? 12
Output example:
Kevin is 12 years old
Question 2.
Write a program that asks for two integer numbers, then displays the addition equation of these two numbers.
Input sample:
Number 1: 19
Number 2: 25
Output sample:
19 + 25 = 44
Hint:
Use input() to ask question and get answer, for example:
num1 = input("Number 1: ")
However, you can only get string data type of answer. In order to get integer number as dimensions, you need to use int(input(…..)) which will convert from string answer into a integer number, for example:
num1 = int(input("Number 1: "))
Sorry, the comment form is closed at this time.