Re: [Tutor] Difference between %f and %F string formatting?

2017-04-26 Thread Tim Peters
[boB Stepp , on %i/%d and %f/%F] > Hmm. I'm surprised this slight distinction was worth keeping two > format codes that otherwise do the same thing. Is there an actual > need for these due to Python being implemented behind the scenes in C? The implementation is irrelevant to this. What is rele

Re: [Tutor] Sets question

2017-04-26 Thread Phil
On Thu, 27 Apr 2017 01:58:39 + eryk sun wrote: > That exception indicates you probably used set(int(num)) instead of > either {int(num)} or set([int(num)]). Thank you Eryl, you are correct. Problem solved. -- Regards, Phil ___ Tutor maillist -

Re: [Tutor] Difference between %f and %F string formatting?

2017-04-26 Thread eryk sun
On Thu, Apr 27, 2017 at 2:19 AM, Tim Peters wrote: > [boB Stepp ] > >> I cannot find any discernible >> difference between '%f' % and '%F' % >> . Is there any or do they duplicate >> functionality? If the latter, why are there two ways of doing the >> same thing? > > They differ only in the ca

Re: [Tutor] Difference between %f and %F string formatting?

2017-04-26 Thread boB Stepp
On Wed, Apr 26, 2017 at 9:19 PM, Tim Peters wrote: > [boB Stepp ] >> My Google-fu must be weak tonight. > > Look here: > > https://en.wikipedia.org/wiki/Printf_format_string Thanks. From the %d versus %i links I found, I should have pursued the C history more diligently for the %f versus %F

Re: [Tutor] Difference between %f and %F string formatting?

2017-04-26 Thread Tim Peters
[boB Stepp ] > My Google-fu must be weak tonight. Look here: https://en.wikipedia.org/wiki/Printf_format_string > I cannot find any discernible > difference between '%f' % and '%F' % > . Is there any or do they duplicate > functionality? If the latter, why are there two ways of doing the

[Tutor] Difference between %f and %F string formatting?

2017-04-26 Thread boB Stepp
My Google-fu must be weak tonight. I cannot find any discernible difference between '%f' % and '%F' % . Is there any or do they duplicate functionality? If the latter, why are there two ways of doing the same thing? I had a similar question for %d and %i, but googling suggests these are inheri

Re: [Tutor] Sets question

2017-04-26 Thread boB Stepp
On Wed, Apr 26, 2017 at 8:34 PM, Phil wrote: > On Wed, 26 Apr 2017 18:56:40 -0600 > Mats Wichmann wrote: > >> On 04/26/2017 06:33 PM, Phil wrote: >> > Another question I'm afraid. >> > >> > If I want to remove 1 from a set then this is the answer: >> > >> > set([1,2,3]) - set([1]) >> > >> > I had

Re: [Tutor] Sets question

2017-04-26 Thread eryk sun
On Thu, Apr 27, 2017 at 1:34 AM, Phil wrote: > I did try {int(num)} but that resulted in an error that said something along > the lines of int not being iterable. I'll have another look at that idea. That exception indicates you probably used set(int(num)) instead of either {int(num)} or set([int

Re: [Tutor] Sets question

2017-04-26 Thread Phil
On Wed, 26 Apr 2017 18:56:40 -0600 Mats Wichmann wrote: > On 04/26/2017 06:33 PM, Phil wrote: > > Another question I'm afraid. > > > > If I want to remove 1 from a set then this is the answer: > > > > set([1,2,3]) - set([1]) > > > > I had this method working perfectly until I made a change to

Re: [Tutor] Sets question

2017-04-26 Thread eryk sun
On Thu, Apr 27, 2017 at 12:33 AM, Phil wrote: > Another question I'm afraid. > > If I want to remove 1 from a set then this is the answer: > > set([1,2,3]) - set([1]) You can also use set literals here, with the caveat that {} is ambiguous, and Python chooses to make it an empty dict instead of a

Re: [Tutor] Sets question

2017-04-26 Thread boB Stepp
On Wed, Apr 26, 2017 at 7:33 PM, Phil wrote: > Another question I'm afraid. > > If I want to remove 1 from a set then this is the answer: > > set([1,2,3]) - set([1]) > > I had this method working perfectly until I made a change to cure another bug. > > So, I have a set represented in the debugger

[Tutor] Sets question

2017-04-26 Thread Phil
Another question I'm afraid. If I want to remove 1 from a set then this is the answer: set([1,2,3]) - set([1]) I had this method working perfectly until I made a change to cure another bug. So, I have a set represented in the debugger as {1,2,3} and again I want to remove the one. Only this ti

Re: [Tutor] change the position and updated

2017-04-26 Thread Sarika Shrivastava
Thanks you Neeraj giving the solution of problem I was trying as but not able to find right solution Thanks to others also for giving a nice advice On Wed, Apr 26, 2017 at 4:36 AM, Neeraj Sharma wrote: > c = [(12, 45), (1234, 567), (12345, 0), (678, 123456)] > > max_length = 0 > for key,value

Re: [Tutor] change the position and updated

2017-04-26 Thread Neeraj Sharma
c = [(12, 45), (1234, 567), (12345, 0), (678, 123456)] max_length = 0 for key,value in c: list1 = [] list2 = [] for i in str(key): list1.append(i) for j in str(value): list2.append(j) if (len(list1)>len(list2)): max_length = len(list1) else:

Re: [Tutor] change the position and updated

2017-04-26 Thread Neeraj Sharma
Hi, Find the code below c = [(12, 45), (1234, 567), (12345, 0), (678, 123456)] max_length = 0 for key,value in c: list1 = [] list2 = [] for i in str(key): list1.append(i) for j in str(value): list2.append(j) if (len(list1)>len(list2)): max_lengt

Re: [Tutor] change the position and updated

2017-04-26 Thread Peter Otten
Sarika Shrivastava wrote: > Input : > c=[(12,45),(1234,567),(12345,0),(678,123456)] > > #o/p==1425 > #o/p==1526374 > #0/p==102345 > #o/p===617283456 > > Question explanation: > > in list c we have some tuples so I need to take tuple value one by one and > change the position of value like wise

[Tutor] change the position and updated

2017-04-26 Thread Sarika Shrivastava
Input : c=[(12,45),(1234,567),(12345,0),(678,123456)] #o/p==1425 #o/p==1526374 #0/p==102345 #o/p===617283456 Question explanation: in list c we have some tuples so I need to take tuple value one by one and change the position of value like wise first tuple value (12 ,45) then then 1 we pick u

Re: [Tutor] Tkinter layout question

2017-04-26 Thread Phil
On Tue, 25 Apr 2017 23:27:05 +0100 Alan Gauld via Tutor wrote: > Your messages come into the moderation queue, I'm > not sure why because the moderation flag is not > set on your account(it is automatically for new > members). > > I'll have a closer look next eek when I get back. Thanks Alan,