Answer:
def main():
name = input("What is your name? ")
if not name == "" or "":
age = int(input("What is your age? "))
print("Hello " + name + "! You were born in " + str(2021 - age))
main()
Explanation:
Self explanatory
Answer:
Statement to get input values:-
cin>>birthMonth>>birthYear;
Statement for output:-
cout<<birthMonth<<"/"<<birthYear<<endl;
Explanation:
The statements are in C++ language.
To get the input we use cin in C++ with >>.
We are taking the input of birthMonth and birthYear.
For printing we use cout .We have printed birthMonth then slash and then birthYear.
Solution :
# Reading principle amount from user
= eval(
Enter principle amount: "))
# Reading time duration in number of year from user
years = eval(input("Enter time duration in number of year: "))
# Reading interest rate from user
annualInterestRate = eval(input("Interest rate: "))
# calculating futureValue using user input data
futureValue = accountPresentValue * (1 + annualInterestRate / 100) ** years
# printing calculated futureValue to console
print("Final balance =",futureValue)