By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Syntax error from a total newbie

P: 1
im super duper fresh to learning python and can't for the life of me get this syntax to go away, its happening on the print line

name = requestString("Enter your name:")

age = requestInteger("Enter your age:")

print name,"you are" age "years old" "!" "That's great" "!"

Invalid syntax Your code contains at least one syntax error, meaning it is not legal jython

any help would be greatly appreciated!

thanks
Jun 5 '17 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 621
See the string format at this tutorial http://www.informit.com/articles/article.aspx?p=674692
Expand|Select|Wrap|Line Numbers
  1. print "%s you are %s years old! That's great!" % (name, age)
Jun 6 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.