On 09/27/2016 09:20 PM, Steven D'Aprano wrote:
On Wednesday 28 September 2016 12:48, Larry Hudson wrote:
As they came through in the newsgroup, BOTH run correctly, because both
versions had leading spaces only.
(I did a careful copy/paste to check this.)
Copying and pasting from the news clie
On Wednesday 28 September 2016 12:48, Larry Hudson wrote:
> As they came through in the newsgroup, BOTH run correctly, because both
> versions had leading spaces only.
> (I did a careful copy/paste to check this.)
Copying and pasting from the news client may not be sufficient to show what
whites
On 09/26/2016 01:57 PM, Cai Gengyang wrote:
Ok it works now:
for row in range(10):
for column in range(10):
print("*",end="")
but how is it different from ---
for row in range
Cai Gengyang wrote:
How are you running the interactive interpreter? Are you
using IDLE, or are you running Python in a command window? --- IDLE
I don't normally use IDLE on MacOSX, so I had to try it to
find out. I think I know what your problem is now.
When you type a line into IDLE ending w
On Tuesday, September 27, 2016 at 2:14:05 PM UTC+8, Cai Gengyang wrote:
> We're trying to help, but we need to know more about the
> environment you're using to enter your code.
>
> What operating system are you using? --- OSX Yosemite Version 10.10.2
>
> How are you running the interactive int
We're trying to help, but we need to know more about the
environment you're using to enter your code.
What operating system are you using? --- OSX Yosemite Version 10.10.2
How are you running the interactive interpreter? Are you
using IDLE, or are you running Python in a command window? --- ID
Cai Gengyang wrote:
I'll still be asking for help here. Please help out a newbie.
We're trying to help, but we need to know more about the
environment you're using to enter your code.
What operating system are you using?
How are you running the interactive interpreter? Are you
using IDLE, or
On Monday, September 26, 2016 at 9:57:52 PM UTC+1, Cai Gengyang wrote:
> Ok it works now:
>
> >>>for row in range(10):
> for column in range(10):
>print("*",end="")
>
>
>
>
>
Sure, I just sent in a subscription request to it ... but I'll still be asking
for help here. Please help out a newbie. When I master this language I can help
other new users too (This is good for the world and for everyone involved).
Ideally, Information and education should be free and not loc
Cai Gengyang :
> What is a tab and what is a space in python and what's the difference
> ?
>
> Which piece of code is indented with tabs and which one is indented
> with spaces ?
Key questions that Python gurus are having a hard time answering!
Equally confusing, you might run into this phantom p
Ok it works now:
>>>for row in range(10):
for column in range(10):
print("*",end="")
but how is it different from ---
>>> for row in range(10):
for column in range(10)
On 9/26/2016 12:54 PM, Cai Gengyang wrote:
Which piece of code is indented with tabs and which one is indented with spaces
?
I told you in my initial answer, where I said, referring to the two
indented lines in one 'piece of code', "These indents are 4 spaces and 1
tabs." It is the mixture
On 09/26/2016 08:25 AM, Cai Gengyang wrote:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
It is NOT weird. Python is being consistent, YOU are not.
These examples are NOT "exactly the same code
Cai Gengyang writes:
> What is a tab and what is a space in python and what's the difference
> ?
Try print('x\tx') in Python to see a tab character between the two x's.
For me it looks the same as seven spaces, for you it will also look like
some amount of whitespace but it might be a different a
On 09/26/2016 06:54 PM, Cai Gengyang wrote:
What is a tab and what is a space in python and what's the difference ?
Which piece of code is indented with tabs and which one is indented with spaces
?
Please do not top-post in this list. Put your text after the message you
quote.
Tabs and sp
On Tue, 27 Sep 2016 01:25 am, Cai Gengyang wrote:
> I just wanted to note that sometimes the code works, sometimes it doesn't.
> (even though both are exactly the same code) ... Weird , dum dum dum
They are not the same code. One of them mixes tabs and spaces for the same
indent level, the other
What is a tab and what is a space in python and what's the difference ?
Which piece of code is indented with tabs and which one is indented with spaces
?
On Tuesday, September 27, 2016 at 12:40:16 AM UTC+8, MRAB wrote:
> On 2016-09-26 16:25, Cai Gengyang wrote:
> > I just wanted to note that
On 2016-09-26 16:25, Cai Gengyang wrote:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
for row in range(10):
for column in range(10):
print("*",end="")
SyntaxError: inco
On 09/26/2016 05:25 PM, Cai Gengyang wrote:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
for row in range(10):
for column in range(10):
print("*",end="")
SyntaxError:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
>>> for row in range(10):
for column in range(10):
print("*",end="")
SyntaxError: inconsistent use of tabs and spaces in inde
On Monday 26 September 2016 18:32, Cai Gengyang wrote:
> These are my attempts ---
That's nice. Do you have a question?
> SyntaxError: inconsistent use of tabs and spaces in indentation
When you indent, press TAB or SPACE but not both.
This error can only happen if you are use spaces for some
Cai Gengyang writes:
> These are my attempts ---
>
for row in range(10):
> for column in range(10):
> print("*",end=" ")
>
> SyntaxError: inconsistent use of tabs and spaces in indentation
What do you type yourself? Could it be that your software starts the
second line with
Steven D'Aprano writes:
> P.S. Hey Jussi, is the backspace key on your keyboard broken? Every
> time somebody bottom-posts without trimming, a pixie dies...
I was annoyed by the top-posted one-liner in response to the last line
of Terry's response. I responded in kind and then it was too late. I'
These are my attempts ---
>>> for row in range(10):
for column in range(10):
print("*",end=" ")
SyntaxError: inconsistent use of tabs and spaces in indentation
>>> for row in range(10):
for column in range(10):
print("*",end=" ")
SyntaxError: expected an indented
On Monday 26 September 2016 17:21, Jussi Piitulainen wrote:
> Cai Gengyang writes:
[snip 80 or so lines]
> Reindent your lines.
In case Cai doesn't know what "reindent" means:
It depends on your text editor. At worst, you have to delete all the indents,
and re-enter them, using ONLY spaces, o
Cai Gengyang writes:
> So what do i need to do to correct the error ?
>
> Regards
>
>
> On Monday, September 26, 2016 at 2:48:16 PM UTC+8, Terry Reedy wrote:
>> On 9/26/2016 1:59 AM, Cai Gengyang wrote:
>> > Why is it that you need a print() at the end to create the table for
>> > example 1:
>>
So what do i need to do to correct the error ?
Regards
On Monday, September 26, 2016 at 2:48:16 PM UTC+8, Terry Reedy wrote:
> On 9/26/2016 1:59 AM, Cai Gengyang wrote:
> > Why is it that you need a print() at the end to create the table for
> > example 1:
> >
> > Example 1 ---
> >
> for r
On 9/26/2016 1:59 AM, Cai Gengyang wrote:
Why is it that you need a print() at the end to create the table for example 1:
Example 1 ---
for row in range(10):
for column in range(10):
print("*",end=" ")
# Print a blank line for next row
print()
These indents are either 4
Cai Gengyang writes:
> Why is it that you need a print() at the end to create the table for
> example 1:
>
> Example 1 ---
>
for row in range(10):
> for column in range(10):
> print("*",end=" ")
>
> # Print a blank line for next row
> print()
[- -]
> When I try to do e
Why is it that you need a print() at the end to create the table for example 1:
Example 1 ---
>>> for row in range(10):
for column in range(10):
print("*",end=" ")
# Print a blank line for next row
print()
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
30 matches
Mail list logo