Syntax error from a total newbie

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jezabel
    New Member
    • Jun 2017
    • 1

    Syntax error from a total newbie

    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
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    See the string format at this tutorial http://www.informit.com/articles/article.aspx?p=674692
    Code:
    print "%s you are %s years old! That's great!" % (name, age)

    Comment

    Working...