Hi Team,
I am learning puthon and trying the following code.
But getting the following error.
Please help me in knowing the code in better way.
OS Linux
Python version 2.7.13
def demo(s, exclaim):
#"""
# Returns the string 's' repeated 3 times.
# If exclaim is true, add exclamati
On 05/02/2019 12:32, Sonia Miglani wrote:
> OS Linux
> Python version 2.7.13
Can you tell us how you are creating the file?
Which editor are you using? It looks like there may be
some spurious characters in your file.
> def demo(s, exclaim):
> #"""
> # Returns the string 's' repeated 3 t
Sonia Miglani wrote:
> Hi Team,
>
> I am learning puthon and trying the following code.
>
> But getting the following error.
>
> Please help me in knowing the code in better way.
>
>
> OS Linux
> Python version 2.7.13
>
>
>
> def demo(s, exclaim):
> #"""
> # Returns the string 's'
>> Error:
>> ./python2.py: line 1: syntax error near unexpected token `('
>
> That is not a Python error, that's a complaint of your shell.
> If you make a Python script executable you also have to insert the proper
> hash-bang line. In the case of Python 2
>
> #!/usr/bin/python2
>
> will pro
On 05/02/2019 14:15, Peter Otten wrote:
>> Error:
>> ./python2.py: line 1: syntax error near unexpected token `('
>
> That is not a Python error, that's a complaint of your shell.
Oh, good catch Peter.
I never noticed the start of the line I just read the text and saw the
weird backtick...
--