Re: [Tutor] Sets question

2017-04-27 Thread Phil
On Thu, 27 Apr 2017 11:49:55 +0200 Peter Otten <__pete...@web.de> wrote: > I'd like to bring to your attention the discard() method > > >>> s = {1, 2, 3} > >>> s.discard(int(v)) > >>> s > {2, 3} > > which allows you to avoid building the throwaway single-entry set. Thank you Peter. I have been

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

2017-04-27 Thread Cameron Simpson
On 26Apr2017 22:51, Tim Peters wrote: [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

Re: [Tutor] Sets question

2017-04-27 Thread Peter Otten
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 as {1,2,3} and again I want

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

2017-04-27 Thread Mats Wichmann
F means print it in uppercase. That's really an edge case for a float, that would only apply to the special values infinity and not-a-number. On April 26, 2017 8:08:16 PM MDT, boB Stepp wrote: >My Google-fu must be weak tonight. I cannot find any discernible >difference between '%f' % and '%F'

Re: [Tutor] Sets question

2017-04-27 Thread Mats Wichmann
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 cure another bug. > > So, I have a set represented in the debugger as {1,

Re: [Tutor] change the position and updated

2017-04-27 Thread Peter Otten
Peter Otten wrote: > 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 > If that's not enough to get a working solution you may come back here once > you have some code. OK, won't happ