0

see first elif statement for syntax error, where have i gone wrong??
this is only a section of code, help very much appreciated.

if dice == dice2 :
    print ("The scores on both dice remain constant, no changes are made.")

elif dice > dice2 :
    print ("The scores of the two dice thrown are not the same.")
    print (a, "'s new strength is", difference, "+", c "and the new skill value is", difference2, "+", cc)

elif dice < dice2 :
    print ("The scores of the two dice thrown are not the same.")
    print (b, "'s new strength is", difference, "-", d "and the the new skill value is", difference2, "-", dd)

else :
    print ("I think we have an error!")

Edited by zahra97

4
Contributors
3
Replies
38
Views
3 Years
Discussion Span
Last Post by Daemon_CC
0

The problem is c "and the new skill value is": there's only a space between c and the string - no comma.

0

Same after "d" missing comma.
Learn to use string formatting.

>>> a = 100
>>> difference = 'high'
>>> print('The gap between {} and 1000000 is {}'.format(a, difference))
The gap between 100 and 1000000 is high

http://ebeab.com/2012/10/10/python-string-format/

A good Python editor will spot error like this for you.
Pycharm has now a Free Community Edition,that's good.

Edited by snippsat

0

Missing Comma in two lines:

c "and the new skill value is"

d "and the the new skill value is"
may be syntax error is due to the missing commas in above two statements...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.