Python syntax error because of version conflicts.

0 votes

I found a python script on the internet and try to run it like this

python py-exmple.py

I get this error:

File "py-exmple.py", line 93

    print json.dumps(evaluate(), indent=4)

             ^

SyntaxError: invalid syntax

I have python installed.

Aug 13, 2018 in Blockchain by digger
• 27,620 points
23 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Hey, please mention the version of python you are using.
answered Aug 13, 2018 by Omkar
• 65,850 points
I am using version 3.6.5
0 votes

As mentioned in the reply to my question, you are using version 3.6.5. 

In python 3.x, you have to add braces for your code.

Change your code to this syntax and it will work.

print( json.dumps(evaluate(), indent=4) )
answered Aug 13, 2018 by Omkar
• 65,850 points

Related Questions In Blockchain

0 votes
1 answer

Blockchain Python Syntax Error

Look here:  print('Block #{} has been added to ...READ MORE

answered Jul 13, 2018 in Blockchain by Christine
• 15,790 points
41 views
0 votes
1 answer

Syntax Error running on Python

You are missing the closing parenthesis: hashlib.sha256(self.index + ...READ MORE

answered Sep 21, 2018 in Blockchain by digger
• 27,620 points
10 views
0 votes
1 answer
0 votes
1 answer

How to solve “More than one instance of bitcore-lib found” error?

There is a temp solution here. ~/bitcore-explorers/node_modules/bitcore-lib/index.js line 7: bitcore.versionGuard ...READ MORE

answered Jul 25, 2018 in Blockchain by slayer
• 29,040 points
328 views
+2 votes
1 answer
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 27,620 points
133 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
63 views
0 votes
1 answer

Ethereum generating genesis Python Syntax

print in python3 is a method not a ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 65,850 points
17 views
0 votes
1 answer

Blockchain: Installing an earlier version of ethereum using apt-get on

geth does not make the previous version available ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 65,850 points
37 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.