February 26th, 2005, 04:50 PM
Syntax Error in simple string comparison
What is wrong with this code?
This is actually just thought to take the path of a file, and then make sure, that 'C:/' is not entered twice.
Source = raw_input("File's path: C:/")
If Source[0:3] == 'C:/':
print 'Invalid path'
When I try to run it though, I am getting an error message at the variable 'Source', which is marked as invalid syntax. Why???
February 26th, 2005, 05:23 PM
You are using a capital letter in your if keyword, this is significant because Python is case sensitive .