On 5/29/2024 10:59 AM, MRAB via Python-list wrote:
On 2024-05-29 15:32, Thomas Passin via Python-list wrote:
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to uppercase
On 2024-05-29, Mats Wichmann via Python-list wrote:
> On 5/29/24 08:02, Grant Edwards via Python-list wrote:
>> On 2024-05-29, Chris Angelico via Python-list wrote:
>>
>>> print(f"if block {name[index]=} {index=}")
>>
>> Holy cow! How did I not know about the f-string {=} thing?
>
> It's more
On 2024-05-29 15:32, Thomas Passin via Python-list wrote:
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to uppercase every other letter in a string.
Thanks all, KMW
> On 29 May 2024, at 05:38, Kevin M. Wilson via Python-list
> wrote:
>
> The format in this email is not of my making, should someone know, how to do
> this so that it's a readable script do tell!
> KMW
Your mail program may have a plain-text mode to compose messages in try using
that.
B
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to uppercase every other letter in a string.
Thanks all, KMW
Simpler is good, and readability is good. For a simple con
On 5/29/24 08:02, Grant Edwards via Python-list wrote:
On 2024-05-29, Chris Angelico via Python-list wrote:
print(f"if block {name[index]=} {index=}")
Holy cow! How did I not know about the f-string {=} thing?
It's more recent than f-strings in general, so it's not that hard to miss.
--
On 2024-05-29, Chris Angelico via Python-list wrote:
> print(f"if block {name[index]=} {index=}")
Holy cow! How did I not know about the f-string {=} thing?
--
Grant
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 29 May 2024 at 23:06, Dan Sommers via Python-list
wrote:
> (For the history-impaired, getopt existed long before Python and will
> likely exist long after it, but getopt's "replacement" optparse lasted
> only from 2003 until 2011.)
Depends on your definition of "lasted". It's not getting
On 2024-05-29 at 17:14:51 +1000,
Chris Angelico via Python-list wrote:
> I wouldn't replace str.format() everywhere, nor would I replace
> percent encoding everywhere - but in this case, I think Thomas is
> correct. Not because it's 2024 (f-strings were brought in back in
> 2015, so they're hardl
On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote:
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list
wrote:
By which Thomas means stuff like this:
print(f'if block {name[index]} and index {index}')
Notice the leading "f'". Personally I wouldn't even go that far, jus
x % 2 == 0):
> 8 print('letter to upper = {}, index {}!'.format(name[index],
index))
9 name = name[index].upper()
10 print('if block {} and index {}'.format(name[index], index))
Index
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list
wrote:
> By which Thomas means stuff like this:
>
> print(f'if block {name[index]} and index {index}')
>
> Notice the leading "f'". Personally I wouldn't even go that far, just:
>
> print('if block', name[index], 'and index',
On 29May2024 01:14, Thomas Passin wrote:
Also, it's 2024 ... time to start using f-strings (because they are
more readable than str.format())
By which Thomas means stuff like this:
print(f'if block {name[index]} and index {index}')
Notice the leading "f'". Personally I wouldn't even go t
name[index].upper()
10 print('if block {} and index {}'.format(name[index], index))
IndexError: string index out of
range***
So, I'm doing something... Stupid!!
***
"
ubbed it in the second interation through the string: range error... HOW?
The following is my effort to understand how to process a string, letter, by
letter:
def myfunc(name): index = 0 howmax = len(name) # while (index <=
howmax): while (index < howmax): if (index % 2 ==
t('letter to upper = {}, index {}!'.format(name[index],
index))
9 name = name[index].upper()
10 print('if block {} and index {}'.format(name[index], index))
IndexError: string index out of
range***
So, I&
at's because Py2 has two different integer types, int and long.
> I am raising this because,
>
> (a) IF xrange in Py3 is a simple "port" from Py2, then it won't handle
> Python integers either.
>
> AND
>
> (b) IF xrange in Py3 is intended to be equivalent t
n it won't handle
Python integers either.
AND
(b) IF xrange in Py3 is intended to be equivalent to range (which, even in
Py2, does handle Python integers)
THEN
It could be argued that xrange in Py3 needs some attention from the
developer(s).
Stephen Tucker.
On Thu, Mar 2, 2023 at 6:24 PM
On 2023-03-02, Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
>
On Thu, 2 Mar 2023 at 22:27, Stephen Tucker wrote:
>
> Hi,
>
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produ
On 2023-03-02 at 11:25:49 +,
Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a lis
Hi,
The range function in Python 2.7 (and yes, I know that it is now
superseded), provokes a Memory Error when asked to deiliver a very long
list of values.
I assume that this is because the function produces a list which it then
iterates through.
1. Does the range function in Python 3.x
Op 11/04/2022 om 02:31 schreef Dan Stromberg:
It sounds a little like you're looking for interval arithmetic.
Maybe https://pypi.org/project/python-intervals/1.5.3/ ?
Not completely but it suggested an idea to explore.
--
Antoon.
--
https://mail.python.org/mailman/listinfo/python-list
Op 11/04/2022 om 02:01 schreef duncan smith:
On 10/04/2022 21:20, Antoon Pardon wrote:
Op 9/04/2022 om 02:01 schreef duncan smith:
On 08/04/2022 22:08, Antoon Pardon wrote:
Well my first thought is that a bitset makes it less obvious to
calulate
the size of the set or to iterate over it
4:19 AM Antoon Pardon wrote:
>
>> I am working with a list of data from which I have to weed out duplicates.
>> At the moment I keep for each entry a container with the other entries
>> that are still possible duplicates.
>>
>> The problem is sometimes that is all
On 2022-04-10 at 22:20:33 +0200,
Antoon Pardon wrote:
>
>
> Op 9/04/2022 om 02:01 schreef duncan smith:
> > On 08/04/2022 22:08, Antoon Pardon wrote:
> > >
> > > Well my first thought is that a bitset makes it less obvious to calulate
> > > the size of the set or to iterate over its elements.
ach entry a container with the other entries
> that are still possible duplicates.
>
> The problem is sometimes that is all the rest. I thought to use a range
> object for these cases. Unfortunatly I sometimes want to sort things
> and a range object is not comparable with a list or a tupl
On 10/04/2022 21:20, Antoon Pardon wrote:
Op 9/04/2022 om 02:01 schreef duncan smith:
On 08/04/2022 22:08, Antoon Pardon wrote:
Well my first thought is that a bitset makes it less obvious to calulate
the size of the set or to iterate over its elements. But it is an idea
worth exploring.
Op 9/04/2022 om 02:01 schreef duncan smith:
On 08/04/2022 22:08, Antoon Pardon wrote:
Well my first thought is that a bitset makes it less obvious to calulate
the size of the set or to iterate over its elements. But it is an idea
worth exploring.
def popcount(n):
"""
Returns the
ally contain all other
records (which in this case are the indexes into the population list).
But that will eat a lot of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually
containing
them. A range object almost works, with the only probl
re the indexes into the population list).
But that will eat a lot of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually
containing
them. A range object almost works, with the only problem it is not
comparable with a list.
Then writ
population list).
But that will eat a lot of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually
containing
them. A range object almost works, with the only problem it is not
comparable with a list.
Is there any reason why you can't
of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually
containing
them. A range object almost works, with the only problem it is not
comparable with a list.
Is there any reason why you can't use ints? Just set the relevant bits.
d to be unusable,
the bucket to be associated with it should conceptually contain all other
records (which in this case are the indexes into the population list).
But that will eat a lot of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually
containi
should conceptually contain all other
records (which in this case are the indexes into the population list).
But that will eat a lot of memory. So I want some object that behaves as
if it is a (immutable) list of all these indexes without actually containing
them. A range object almost works, with t
On Fri, 8 Apr 2022 at 16:26, Peter J. Holzer wrote:
> Unless you have a unique immutable identifier that's enforced by
> some authority (like a social security number[1]), I don't think there
> is a chance to do that reliably in a program (although with enough data,
> a heuristic may be good enoug
On 2022-04-07 17:16:41 +0200, Antoon Pardon wrote:
> Op 7/04/2022 om 16:08 schreef Joel Goldstick:
> > On Thu, Apr 7, 2022 at 7:19 AM Antoon Pardon wrote:
> > > I am working with a list of data from which I have to weed out duplicates.
> > > At the moment I keep for each entry a container with the
are still possible duplicates.
The problem is sometimes that is all the rest. I thought to use a range
object for these cases. Unfortunatly I sometimes want to sort things
and a range object is not comparable with a list or a tuple.
So I have a list of items where each item is itself a list or range
ifferent bits.
>
>So all records with the same firstname can be duplicates. But if I have
>a record in which the firstname is missing, it can at that point be
>a duplicate of all other records.
The description is still not clear enough. Especially, it does
not show where `range` objects
is sometimes that is all the rest. I thought to use a range
object for these cases. Unfortunatly I sometimes want to sort things
and a range object is not comparable with a list or a tuple.
So I have a list of items where each item is itself a list or range object.
I of course could sort this by
is all the rest. I thought to use a range
> object for these cases. Unfortunatly I sometimes want to sort things
> and a range object is not comparable with a list or a tuple.
>
> So I have a list of items where each item is itself a list or range object.
> I of course could sort this by
I am working with a list of data from which I have to weed out duplicates.
At the moment I keep for each entry a container with the other entries
that are still possible duplicates.
The problem is sometimes that is all the rest. I thought to use a range
object for these cases. Unfortunatly I
On 2020-12-14 21:21, Schachner, Joseph wrote:
> >>> r = range(10)
> So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
In Python 3.x, r is *not* a list. It is a custom object/class.
> >>> 2 in r
> True
> As expected.
I'm not sure wha
On Mon, Dec 14, 2020 at 3:07 PM Dan Stromberg wrote:
>
> On Mon, Dec 14, 2020 at 1:23 PM Schachner, Joseph <
> joseph.schach...@teledyne.com> wrote:
>
>> >>> r = range(10)
>> So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
>>
> To get a lis
On Mon, Dec 14, 2020 at 1:23 PM Schachner, Joseph <
joseph.schach...@teledyne.com> wrote:
> >>> r = range(10)
> So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
>
To get a list of consecutive int's, you can use, for EG:
r = list(range(10))
--
https://mail.pytho
On 2020-12-14 at 21:21:43 +,
"Schachner, Joseph" wrote:
> >>> r = range(10)
> So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
In a number of ways, r behaves as if it were that list, but r is
definitely not that list:
>>> r = range(10)
>&g
>>> r = range(10)
So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
>>> 2 in r
True
As expected.
>>> 2.5 in r
False
Also as expected. If you did int(floor(2.5)) in 5 that would be true.
>>> r = range(1, 10, 2)
>>> 2 in r
Fa
On 2020-12-12, Tim Chase wrote:
>
> Hopefully this gives you the hints that you need to troubleshoot.
>
> -tkc
>
>
>
>
Yes it explains a lot.
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
On 2020-12-12 at 10:51:00 -0600,
Tim Chase wrote:
> If you want numeric-range checks, Python provides the lovely
> double-comparison syntax:
>
> >>> x = 5
> >>> 2 < x < 10
> True
Not just numbers:
>>> 'm' < 'n
On 2020-12-12 15:12, Bischoop wrote:
> I need to check if input number is 1-5. Whatever I try it's not
> working. Here are my aproaches to the problem: https://bpa.st/H62A
>
> What I'm doing wrong and how I should do it?
A range is similar to a list in that it contains j
Got it solved here: https://bpa.st/BFJA
--
https://mail.python.org/mailman/listinfo/python-list
ng. That string is not in the range you compare it
to. You need to convert it to an int:
choice = int(input.. )
This is assuming you want a whole number. You compare it against the
list of numbers [1, 2, 3, 4, 5]. If 2.4 is also a valid number, you need
a different comparison. 2.4 is not in this li
I need to check if input number is 1-5. Whatever I try it's not working.
Here are my aproaches to the problem: https://bpa.st/H62A
What I'm doing wrong and how I should do it?
--
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
I've also convert the choice to int() but doesn't help.
--
https://mail.python.org/mailman/listinfo/python-list
On 2020-12-12, Oscar wrote:
> In article ,
> Bischoop wrote:
>>I've also convert the choice to int() but doesn't help.
>
> Oh.. did not read this yet. How did you do this? In both places after
> the input or during the comparison? If so, in which version? Only the
> first version would work. The
In article ,
Bischoop wrote:
>I've also convert the choice to int() but doesn't help.
Oh.. did not read this yet. How did you do this? In both places after
the input or during the comparison? If so, in which version? Only the
first version would work. The other two are just plain wrong.
--
[J|O
On 26/08/2020 12:02, Peter J. Holzer wrote:
On 2020-08-26 22:40:36 +1200, dn via Python-list wrote:
On 26/08/2020 19:58, Joel Goldstick wrote:
[...]
<<< Code NB Python v3.8 >>>
def fp_range( start:float, stop:float, step:float=1.0 )->float:
""&quo
On 8/26/2020 6:40 AM, dn via Python-list wrote:
def fp_range( start:float, stop:float, step:float=1.0 )->float:
"""Generate a range of floating-point numbers."""
if stop <= start:
raise OverflowError( "RangeError: start must be less
On 8/25/20 10:39 PM, ADITYA wrote:
>Dear Sir/Ma’am
>
>I am requesting you to satisfy me about float number in Range function,
>because in the argument of range we can take integer but not double or
>float whenever double as well as float are integer in nature but w
On 2020-08-26 22:40:36 +1200, dn via Python-list wrote:
> On 26/08/2020 19:58, Joel Goldstick wrote:
> > On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
> > > Dear Sir/Ma’am
> > >
> > > I am requesting you to satisfy me about float number in Rang
On 26/08/2020 19:58, Joel Goldstick wrote:
On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
Dear Sir/Ma’am
I am requesting you to satisfy me about float number in Range function,
because in the argument of range we can take integer but not double or
float whenever double as well
On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
>
>Dear Sir/Ma’am
>
>I am requesting you to satisfy me about float number in Range function,
>because in the argument of range we can take integer but not double or
>float whenever double as well as float are integer
Dear Sir/Ma’am
I am requesting you to satisfy me about float number in Range function,
because in the argument of range we can take integer but not double or
float whenever double as well as float are integer in nature but when we
use double/float in, it gives error that- “'
Caledonian26 wrote:
> However, I keep getting the error:
>
> IndexError: list index out of range.
>
> Could anyone give me a helping hand
> as to where I am going wrong?
>
I appended a single arbitrary value for limits
since the limits list ha
On 8/06/20 10:38 AM, MRAB wrote:
On 2020-06-07 23:24, DL Neil via Python-list wrote:
On 8/06/20 7:06 AM, Caledonian26 wrote:
...
However, I keep getting the error: IndexError: list index out of
range. Could anyone give me a helping hand as to where I am going wrong?
When things go wrong
On 2020-06-07 23:24, DL Neil via Python-list wrote:
On 8/06/20 7:06 AM, Caledonian26 wrote:
...
However, I keep getting the error: IndexError: list index out of range. Could
anyone give me a helping hand as to where I am going wrong?
When things go wrong, Python tries to be helpful by
On 8/06/20 7:06 AM, Caledonian26 wrote:
...
However, I keep getting the error: IndexError: list index out of range. Could
anyone give me a helping hand as to where I am going wrong?
When things go wrong, Python tries to be helpful by providing a
"traceback". Please copy-paste
larMappable(cmap=cmap, norm=norm)
plt.gcf().colorbar(sm)
plt.show()
4. Here, a different colour is assigned to each bar in the bar chart depending
on the values in the column 'colourofbars'. I then try to plot a legend showing
this colour gradient scale.
However, I keep getting the error: IndexError: list index out of range. Could
anyone give me a helping hand as to where I am going wrong?
--
https://mail.python.org/mailman/listinfo/python-list
On 19/05/20 6:40 AM, swaroop.sahoo...@gmail.com wrote:
Hi All,
I am using python for doing the following:
I have a matrix which has dimension of 174*993.
Each row of the matrix has some numbers in the range of 30-30.5.
I would like to determine the index of the numbers in the range of 30-30.5 in
Hi All,
I am using python for doing the following:
I have a matrix which has dimension of 174*993.
Each row of the matrix has some numbers in the range of 30-30.5.
I would like to determine the index of the numbers in the range of 30-30.5 in
each row.
I can determine the index of the numbers in
oh not a real bug, i thought the effect had to do with generator working
rather a simple times 0
Abdur-Rahmaan Janhangeer
Mauritius
On Sat, 13 Jul 2019, 16:24 Chris Angelico, wrote:
> On Sat, Jul 13, 2019 at 10:02 PM Abdur-Rahmaan Janhangeer
> wrote:
> >
> > @Thomas thought was a generator bug
On Sat, Jul 13, 2019 at 10:02 PM Abdur-Rahmaan Janhangeer
wrote:
>
> @Thomas thought was a generator bug since instead of returning the usual
> nums it was returning 0 0 0 ...
When you find a bug or strange bit of behaviour, first make sure you
can reproduce it. Then create a small, self-containe
@Thomas thought was a generator bug since instead of returning the usual
nums it was returning 0 0 0 ...
--
https://mail.python.org/mailman/listinfo/python-list
On 13/07/2019 11:54, Abdur-Rahmaan Janhangeer wrote:
> Greetings,
>
> Given this snippet
>
> from itertools import *
> import operator
>
>
> x = [1, 2, 3] # [0, 1, 2, 3, ..., 10]
>
> y = accumulate(x, operator.mul)
>
> print(list(y))
>
> wh
@Frank
So simple. Thanks!
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
--
https://mail.python.org/mailman/listinfo/python-list
On 7/13/19 5:54 AM, Abdur-Rahmaan Janhangeer wrote:
> > Greetings,
> >
> > Given this snippet
> >
> > from itertools import *
> > import operator
> >
> >
> > x = [1, 2, 3] # [0, 1, 2, 3, ..., 10]
> >
> > y = accumulate(x, oper
On 2019-07-13 11:54 AM, Abdur-Rahmaan Janhangeer wrote:
Greetings,
Given this snippet
from itertools import *
import operator
x = [1, 2, 3] # [0, 1, 2, 3, ..., 10]
y = accumulate(x, operator.mul)
print(list(y))
why does x = list(range(5)) produces only zeros?
That is an easy one.
By
Greetings,
Given this snippet
from itertools import *
import operator
x = [1, 2, 3] # [0, 1, 2, 3, ..., 10]
y = accumulate(x, operator.mul)
print(list(y))
why does x = list(range(5)) produces only zeros?
--
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur
MRAB writes:
> On 2019-06-26 22:14, Cecil Westerhof wrote:
>> MRAB writes:
>>
>>> Does Workbook support the 'with' statement?
>>>
>>> If it does, then that's the best way of doing it.
>>>
>>> (Untested)
>>>
>>> with Workbook() as wb_out:
>>> for filepath in filepathArr:
>>>
Cecil Westerhof wrote:
> I was asked to copy a certain line from about 300 Excel lines to a new
> Excel file. That is not something I would like to do by hand and I
> immediately thought: that should be possible with Python.
>
> And it is. I was surprised how fast I could write that with openpyx
On 2019-06-26 22:14, Cecil Westerhof wrote:
MRAB writes:
Does Workbook support the 'with' statement?
If it does, then that's the best way of doing it.
(Untested)
with Workbook() as wb_out:
for filepath in filepathArr:
current_row = []
with load_workbook(
MRAB writes:
> Does Workbook support the 'with' statement?
>
> If it does, then that's the best way of doing it.
>
> (Untested)
>
> with Workbook() as wb_out:
> for filepath in filepathArr:
> current_row = []
>
> with load_workbook(filepath) as wb_in:
>
On 2019-06-26 13:15, Cecil Westerhof wrote:
Cecil Westerhof writes:
I was asked to copy a certain line from about 300 Excel lines to a new
Excel file. That is not something I would like to do by hand and I
immediately thought: that should be possible with Python.
And it is. I was surprised ho
Cecil Westerhof writes:
> Is it necessary to close the workbooks to circumvent a resource
> leak?
Still like to know. When not necessary it is better not to cloes them
I think.
> Is it a problem when a workbook is closed two times? If so I need to
> make sure that this is not possible.
That i
Cecil Westerhof writes:
> I was asked to copy a certain line from about 300 Excel lines to a new
> Excel file. That is not something I would like to do by hand and I
> immediately thought: that should be possible with Python.
>
> And it is. I was surprised how fast I could write that with openpyx
I was asked to copy a certain line from about 300 Excel lines to a new
Excel file. That is not something I would like to do by hand and I
immediately thought: that should be possible with Python.
And it is. I was surprised how fast I could write that with openpyxl.
My first try was not very neat,
) # 0.5414720812182742
print(xsd) # 0.15748041033663002
print(str("{6.5f}".format(xm)))
I get the following error:
IndexError: tuple index out of range
Can someone suggest me why I am getting this error and how to overcome
this?
Show us the full traceback after expanding and reducing t
) # 0.15748041033663002
print(str("{6.5f}".format(xm)))
I get the following error:
IndexError: tuple index out of range
Can someone suggest me why I am getting this error and how to overcome this?
Thanks in advance
print(str("{:6.5f}".format(xm)))
You want to apply the format 6.5
.format(xm)))
I get the following error:
IndexError: tuple index out of range
Can someone suggest me why I am getting this error and how to overcome this?
Thanks in advance
--
https://mail.python.org/mailman/listinfo/python-list
On 18/02/19 8:32 AM, Chris Angelico wrote:
On Mon, Feb 18, 2019 at 6:12 AM DL Neil wrote:
The reason this course caught my attention (and which is relevant to
you, per Chris' and Dennis' recent advice) is that the course revolves
around an 'active textbook'. This intersperses learning material
On Mon, Feb 18, 2019 at 6:12 AM DL Neil wrote:
> > sure you truly understand what is going on. Try to piece together what
> > a section of code is doing, step by step. Write down on a piece of
> > paper what the variables are at each point in the program. Then, AFTER
> > doing the work manually, r
^Bart,
Which course are you attempting?
What are you using as learning material?
(it seems ineffectual)
- further comments interspersed, below:-
On 18/02/19 5:30 AM, Chris Angelico wrote:
On Mon, Feb 18, 2019 at 3:26 AM ^Bart wrote:
I need to do what I wrote in the subject but... I don't u
nd number:"))
> number3 = int( input("Insert the third number:"))
>
> print("Total amount is:")
>
> for x in range(number1,number3):
> y = x+x
> print(y)
>
When you want homework help, it is extremely useful to post the entire
challenge yo
print("Total amount is:")
for x in range(number1,number3):
y = x+x
print(y)
Regards.
^Bart
--
https://mail.python.org/mailman/listinfo/python-list
ote, today:
for i in range(1): pass # 100 million
on Python 2, it used up 1.8GB, up to the limit of my RAM, and it took several
minutes to regain control of my machine (and it never did finish). You don't
expect that in 2018 when executing a simple empty loop.
On Py 2
On 03/20/2018 03:21 PM, Robin Becker wrote:
I don't know how I never came across this before, but there's a curious
asymmetry in the way ranges are limited
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "lic
So eventually I tried this
C:\code\hg-repos\reportlab>\python36\python
-c"s='0123456789';print(repr(s[-5:15]))"
'56789'
C:\code\hg-repos\reportlab>\python36\python
-c"s='0123456789';print(repr(s[-6:15]))"
'456789'
and the light dawned :) seems the negative indexes rules apply to both
On
I don't know how I never came across this before, but there's a curious
asymmetry in the way ranges are limited
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> s = '01234567
On Saturday, July 1, 2017 at 12:48:39 AM UTC-5, Christian Gollwitzer wrote:
> Am 30.06.17 um 04:33 schrieb Rick Johnson:
> > And to further drive home the point, you can manually
> > insert a list literal to prove this:
> >
> > >>> range(10)
&g
On Thursday, June 29, 2017 at 9:58:23 PM UTC-5, Chris Angelico wrote:
> On Fri, Jun 30, 2017 at 12:33 PM, Rick Johnson
> > A better *FIRST* example would be something like this:
> >
> > def add(x, y):
> > return x + y
> >
> > When teaching a student about functions, the first step is
>
1 - 100 of 1394 matches
Mail list logo