May-03-2018, 06:23 PM
Hi,
I am back to working on homework and I have a very simple problem that I can't seem to figure out
I am trying to print a variable as part of a string and it doenst seem to like it
solved it just needed a comma. Thanks!
I am back to working on homework and I have a very simple problem that I can't seem to figure out
I am trying to print a variable as part of a string and it doenst seem to like it
# Create a program that asks the user to enter their name and their age. Print out a message addressed # to them that tells them the year that they will turn 100 years old. name = input ("Please enter your name: ") age = input ("Now please enter your age: ") num=100 - int(age) newdate = 2017 + num print ('You will be 100 in newdate')If I print newdate by itself no problem, if I print the string no problem, if I print the string then new date after '' problems. And then the above problems. If I try turning the value into a string and then printing it still a problem
solved it just needed a comma. Thanks!