On March 16, 2019 5:57:23 PM MDT, Alan Gauld via Tutor wrote:
>On 16/03/2019 18:44, Peter Otten wrote:
>>
>> In Python 3.6 and above you can use f-strings:
>>
> d = dict(a="hello", b="world")
> " ".join(f'{k} "{v}"' for k, v in d.items())
>> 'a "hello" b "world"'
>
>Cool, I'd missed
On 16/03/2019 18:44, Peter Otten wrote:
>
> In Python 3.6 and above you can use f-strings:
>
d = dict(a="hello", b="world")
" ".join(f'{k} "{v}"' for k, v in d.items())
> 'a "hello" b "world"'
Cool, I'd missed f-strings. Time for some reading
Thanks Peter,
--
Alan G
Author of
On 2019-03-16 10:39, Valerio Pachera wrote:
Consider this:
import collections
d = OrderedDict(a='hallo', b='world')
I wish to get a single string like this:
'a "hallo" b "world"'
Notice I wish the double quote to be part of the string.
In other words I want to wrap the value of a and b.
I
Valerio Pachera wrote:
> Consider this:
>
> import collections
> d = OrderedDict(a='hallo', b='world')
>
> I wish to get a single string like this:
>
> 'a "hallo" b "world"'
>
> Notice I wish the double quote to be part of the string.
> In other words I want to wrap the value of a and b.
>
>
On 16/03/2019 17:39, Valerio Pachera wrote:
> I wish to get a single string like this:
>
> 'a "hallo" b "world"'
>
> Notice I wish the double quote to be part of the string.
> In other words I want to wrap the value of a and b.
When dealing with string layouts I tend to go to
string
Consider this:
import collections
d = OrderedDict(a='hallo', b='world')
I wish to get a single string like this:
'a "hallo" b "world"'
Notice I wish the double quote to be part of the string.
In other words I want to wrap the value of a and b.
I was thinking to use such function I created:
- Messaggio originale -
> Da: "Valerio Pachera"
> A: "Tutor Python"
> Inviato: Giovedì, 28 febbraio 2019 13:05:27
> Oggetto: Re: [Tutor] Remove soft line break
> ...
> I noticed that the end of file doesn't get preserve if I create a copy of the
> file ...
I've been told by a
On 13 Mar 2019 18:14, Alan Gauld via Tutor wrote:
On 11/03/2019 16:10, Diana Katz wrote:
> What is the best way to ..program using python - that could recognize
> a 3D object and then rank drawings of the object as to which are more
> accurate.
===>> check this out:
Glenn Dickerson wrote:
> class Student():
>
> def__init__(self, name, major, gpa, is_on_probation):
> self.name = name
> self.major = major
> self.gpa = gpa
> self.is_on_probation = is_on_probation
>
>
> import Student
> student1 = Student('Jim', 'Business',
On 16/03/2019 01:54, Glenn Dickerson wrote:
> class Student():
>
> def__init__(self, name, major, gpa, is_on_probation):
> self.name = name
> self.major = major
> self.gpa = gpa
> self.is_on_probation = is_on_probation
>
>
> import Student
> student1 =
Hi Glenn, and welcome.
On Fri, Mar 15, 2019 at 09:54:41PM -0400, Glenn Dickerson wrote:
> class Student():
> def__init__(self, name, major, gpa, is_on_probation):
> self.name = name
> self.major = major
> self.gpa = gpa
> self.is_on_probation = is_on_probation
class Student():
def__init__(self, name, major, gpa, is_on_probation):
self.name = name
self.major = major
self.gpa = gpa
self.is_on_probation = is_on_probation
import Student
student1 = Student('Jim', 'Business', 3.1, False)
student2 = Student('Pam', 'Art',
12 matches
Mail list logo