-1

I'm a novice at coding, just come back to it after being in the dark for so long, currently trying to complete an assignment, advice appreciated! Line 13 syntax error

import os
#Imports operating system modules
user_file_search = raw_input('Type Millienium2000 ')
#Prompt the user to enter password
encoded = user_file_search.encode('hex')
#Decodes files based on hex

for root, dirs, files in os.walk ('/Desktop/POP/PoP_Coursework_Assignment/Svr1/documents$'):
    for data in files :
        pass_file = open(os.path.join(root,data)).read()

if(encoded in pass_file):
    print'This could be the pass : {}'.format(os.path.join(root,data))
    print 'Located data: {}'.format(pass_file)
#Prints Data retrieved

I've been told that originally it was a indent problem via terminal, I spent some time correcting it I believe and I am now met with

File "oswalk.py", line 13
print'This could be the pass : {}'.format(os.path.join(root,data))
SyntaxError: invalid syntax      ^

Pointing towards # {}' Coding on Ubuntu Python 3 Any help would be appreciated! Thanks

Community
  • 1
  • 1
Thomas Hall
  • 3
  • 1
  • 6

1 Answers1

0

Welcome to Python 3+, print is not a keyword but a function now, it needs brackets when called:

    print ('This could be the pass : {}'.format(os.path.join(root,data)))
    print ('Located data: {}'.format(pass_file))
Learning is a mess
  • 7,479
  • 7
  • 35
  • 71