Re: [Python] django e apache

2017-09-07 Per discussione Riccardo Magliocchetti

Il 07/09/2017 15:55, Franky gmail ha scritto:

Salve lista,

ho bisogno di info su come fare il porting di un django project verso un mio 
server di produzione.


consiglio di iscriverti alla lista django-it e di leggere la documentazione 
ufficiale di django su come fare deploy:

https://docs.djangoproject.com/en/1.11/howto/deployment/

--
Riccardo Magliocchetti
@rmistaken

http://menodizero.it
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] django e apache

2017-09-07 Per discussione Ernesto Arbitrio
In che senso porting? Devi deployare il tuo progetto da qualche parte ?

2017-09-07 15:55 GMT+02:00 Franky gmail :

> Salve lista,
>
> ho bisogno di info su come fare il porting di un django project verso un
> mio server di produzione.
>
> grazie
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


[Python] django e apache

2017-09-07 Per discussione Franky gmail

Salve lista,

ho bisogno di info su come fare il porting di un django project verso un 
mio server di produzione.


grazie

___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Giovanni Porcari

> Il giorno 07 set 2017, alle ore 12:13, Francesco Maida 
>  ha scritto:
> 
> Ragazzi, mi dispiace ma io prendo la strada più lunga ma facilmente 
> comprensibile ;-)
> 


> https://gist.github.com/anonymous/0f30fdac699b9691f6ec282d6ec61042




Pensa q chi lo ha scritto invece in brainfuck:


+[>[-]>[-]>[-]<<<[>+>+>+<<<-]>>>[<<<+>>>-]<>+++<[->-[>+>>]>[+[-<+>]>+>>]<]>[-]>>[-]<>[-]>[-]<<[>+>+<<-]>[<+>-]+<>>[<->[-]]
<<>[>++.+++.++
+++..[-]<-]<[-]<<<>+<[->-[>+>>]>[+[-<+>]>+>>]<]>[-]>>[-]<>[-]>[-]<<[>+>+<<-]>[<+>-]+<>>[<->[-]]<<>[>++
.+++.+..[-]<-]<[-]<<++
++.[-]<+]

 
Leggibile vero ? :D:D


G
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Nicola Larosa
Francesco Maida wrote:
> Ragazzi, mi dispiace ma io prendo la strada più lunga ma facilmente
> comprensibile ;-)
> 
> https://gist.github.com/anonymous/0f30fdac699b9691f6ec282d6ec61042

Vivaddio, qualcuno che ricorda ancora perché siamo qui. Grazie di
cuore.

-- 
Nicola 'tekNico' Larosa 
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Giovanni Porcari

> Il giorno 07 set 2017, alle ore 15:05, Pietro Brunetti  
> ha scritto:
> 
> Molto spartano, ci sarà di meglio, ma penso sia abbastanza ideomatico:
> 
> """
> In [1]: initial_data = [(3,'alice'),(7,'bob'),(11,'charlie')]
> 
> In [2]: prime_by_name = {k:v for v, k in initial_data}
> 
> In [3]: prime_by_name
> Out[3]: {'alice': 3, 'bob': 7, 'charlie': 11}
> 
> In [4]: for num in range(1, 100):  # si può fare la doppia list comprehension
> ...: out = [name for name, prime in prime_by_name.items()
> ...:if not num % prime]
> ...: if out:
> ...: print(''.join(out))
> ...: else:
> ...: print(num)
> …:  



Bello !


G

>   
> 1
> 2
> alice
> 4
> 5
> alice
> bob
> 8
> alice
> 10
> charlie
> alice
> 13
> bob
> alice
> 16
> 17
> alice
> 19
> 20
> bobalice
> charlie
> 23
> alice
> 25
> 26
> alice
> bob
> 29
> alice
> 31
> 32
> alicecharlie
> 34
> bob
> alice
> 37
> 38
> alice
> 40
> 41
> bobalice
> 43
> charlie
> alice
> 46
> 47
> alice
> bob
> 50
> alice
> 52
> 53
> alice
> charlie
> bob
> alice
> 58
> 59
> alice
> 61
> 62
> bobalice
> 64
> 65
> alicecharlie
> 67
> 68
> alice
> bob
> 71
> alice
> 73
> 74
> alice
> 76
> bobcharlie
> alice
> 79
> 80
> alice
> 82
> 83
> bobalice
> 85
> 86
> alice
> charlie
> 89
> alice
> bob
> 92
> alice
> 94
> 95
> alice
> 97
> bob
> alicecharlie
> 
> 
> 
> 
> Il giorno 7 settembre 2017 13:48, Giovanni Porcari 
>  ha scritto:
> 
> > Il giorno 07 set 2017, alle ore 11:02, Carlo Miron  ha 
> > scritto:
> >
> > 2017-09-07 0:58 GMT+02:00 Karim :
> >
> >> 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
> >> :
> >>>
> >>> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
> >>> due:
> >>> - quale linguaggi conosci di più e quanto bene da 1 a 10
> >>> - fizzbuzz in che linguaggio preferisci
> >>
> >> Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
> >> faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
> >> diciamo che ha acceso gli animi :D
> >
> > E così parte il golfing sulla soluzione più breve. la mia è
> >
> >("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))
> 
> 
> 
> Elegante :)
> 
> Ma ora il superfizzbuzz:
> 
> data un array arbitrario di numeri primi associati ad altrettante parole,
> scrivere l'algoritmo che, nell'enumerazione sostituisca al numero primo e ai 
> suoi multipli
> la parola assegnata e nel caso un numero sia multiplo di più numeri primi da 
> sostituire,
> sostituisca con la concatenazione delle parole.
> 
> il caso fizzbuzz è
> 
> superfizzbuzz([(3,'fizz'),(5,'buzz')])
> 
> testare ad esempio con :
> 
> superfizzbuzz([(3,'alice'),(7,'bob'),(11,'charlie')])
> 
> 
> Parte la sfida ;)
> 
> 
> G
> 
> 
> 
> 
> 
> >
> > :P
> >
> > ㎝
> >
> > --
> > |:**THE -WARE LICENSE** *(Revision ㊷)*:
> > |  wrote this mail. As long as you retain this
> > | notice you can do whatever you want with this stuff.
> > | If we meet some day, and you think this stuff is worth it,
> > | you can buy me a  in return. —㎝
> > ___
> > Python mailing list
> > Python@lists.python.it
> > https://lists.python.it/mailman/listinfo/python
> 
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
> 
> 
> 
> -- 
> There is a crack, a crack in everything. That’s how the light gets in
> L. Cohen
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python

___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Pietro Brunetti
Molto spartano, ci sarà di meglio, ma penso sia abbastanza ideomatico:

"""
In [1]: initial_data = [(3,'alice'),(7,'bob'),(11,'charlie')]

In [2]: prime_by_name = {k:v for v, k in initial_data}

In [3]: prime_by_name
Out[3]: {'alice': 3, 'bob': 7, 'charlie': 11}

In [4]: for num in range(1, 100):  # si può fare la doppia list
comprehension
...: out = [name for name, prime in prime_by_name.items()
...:if not num % prime]
...: if out:
...: print(''.join(out))
...: else:
...: print(num)
...:
1
2
alice
4
5
alice
bob
8
alice
10
charlie
alice
13
bob
alice
16
17
alice
19
20
bobalice
charlie
23
alice
25
26
alice
bob
29
alice
31
32
alicecharlie
34
bob
alice
37
38
alice
40
41
bobalice
43
charlie
alice
46
47
alice
bob
50
alice
52
53
alice
charlie
bob
alice
58
59
alice
61
62
bobalice
64
65
alicecharlie
67
68
alice
bob
71
alice
73
74
alice
76
bobcharlie
alice
79
80
alice
82
83
bobalice
85
86
alice
charlie
89
alice
bob
92
alice
94
95
alice
97
bob
alicecharlie




Il giorno 7 settembre 2017 13:48, Giovanni Porcari <
giovanni.porc...@softwell.it> ha scritto:

>
> > Il giorno 07 set 2017, alle ore 11:02, Carlo Miron  ha
> scritto:
> >
> > 2017-09-07 0:58 GMT+02:00 Karim :
> >
> >> 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
> >> :
> >>>
> >>> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
> >>> due:
> >>> - quale linguaggi conosci di più e quanto bene da 1 a 10
> >>> - fizzbuzz in che linguaggio preferisci
> >>
> >> Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
> >> faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
> >> diciamo che ha acceso gli animi :D
> >
> > E così parte il golfing sulla soluzione più breve. la mia è
> >
> >("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))
>
>
>
> Elegante :)
>
> Ma ora il superfizzbuzz:
>
> data un array arbitrario di numeri primi associati ad altrettante parole,
> scrivere l'algoritmo che, nell'enumerazione sostituisca al numero primo e
> ai suoi multipli
> la parola assegnata e nel caso un numero sia multiplo di più numeri primi
> da sostituire,
> sostituisca con la concatenazione delle parole.
>
> il caso fizzbuzz è
>
> superfizzbuzz([(3,'fizz'),(5,'buzz')])
>
> testare ad esempio con :
>
> superfizzbuzz([(3,'alice'),(7,'bob'),(11,'charlie')])
>
>
> Parte la sfida ;)
>
>
> G
>
>
>
>
>
> >
> > :P
> >
> > ㎝
> >
> > --
> > |:**THE -WARE LICENSE** *(Revision ㊷)*:
> > |  wrote this mail. As long as you retain this
> > | notice you can do whatever you want with this stuff.
> > | If we meet some day, and you think this stuff is worth it,
> > | you can buy me a  in return. —㎝
> > ___
> > Python mailing list
> > Python@lists.python.it
> > https://lists.python.it/mailman/listinfo/python
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>



-- 
There is a crack, a crack in everything. That’s how the light gets in
L. Cohen
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Pietro Brunetti
Sì, solo per una versione dell'alfabeto. O Maiuscolo o minuscolo.

Per esempio
"""
In [1]: import string

In [2]: string.ascii_uppercase
Out[2]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

In [3]: every_uppercase_char = set(string.ascii_uppercase)

In [4]: example = set("the quick brown fox jumps over the lazy dog".upper())

In [5]: not(every_uppercase_char - example)
Out[5]: True

In [6]: example2 = set("the quick brown fox jumps over the lazy
do".upper())  # senza la 'g'

In [7]: not(every_uppercase_char - example2)
Out[7]: False
"""

Da notare che faccio la sottrazione in un verso per evitare problemi con la
punteggiatura e gli spazi




2017-09-07 13:47 GMT+02:00 Michele Finelli :

> * Andrea D'Amore (and.dam...@gmail.com) [170907 13:35]:
>
>> […]
>>
>>> La soluzione migliore passa per i set
>>>
>>
>> Come:
>>
>>set('abcdefghijklmnopqrstuvwxyz') <= set(test_sentence)
>>
>> ?
>>
>>
> non ci vuole anche un .lower() ?
>
> --
>   .*.finelli
>   /V\
>  (/ \) --
>  (   )   Linux: Friends dont let friends use Piccolosoffice
>  ^^-^^ --
>
> Am'ar'c'mand, fe` pulid.
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>



-- 
There is a crack, a crack in everything. That’s how the light gets in
L. Cohen
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Giovanni Porcari

> Il giorno 07 set 2017, alle ore 11:02, Carlo Miron  ha 
> scritto:
> 
> 2017-09-07 0:58 GMT+02:00 Karim :
> 
>> 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
>> :
>>> 
>>> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
>>> due:
>>> - quale linguaggi conosci di più e quanto bene da 1 a 10
>>> - fizzbuzz in che linguaggio preferisci
>> 
>> Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
>> faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
>> diciamo che ha acceso gli animi :D
> 
> E così parte il golfing sulla soluzione più breve. la mia è
> 
>("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))



Elegante :)

Ma ora il superfizzbuzz:

data un array arbitrario di numeri primi associati ad altrettante parole, 
scrivere l'algoritmo che, nell'enumerazione sostituisca al numero primo e ai 
suoi multipli
la parola assegnata e nel caso un numero sia multiplo di più numeri primi da 
sostituire, 
sostituisca con la concatenazione delle parole.

il caso fizzbuzz è

superfizzbuzz([(3,'fizz'),(5,'buzz')])

testare ad esempio con :

superfizzbuzz([(3,'alice'),(7,'bob'),(11,'charlie')])


Parte la sfida ;)


G





> 
> :P
> 
> ㎝
> 
> -- 
> |:**THE -WARE LICENSE** *(Revision ㊷)*:
> |  wrote this mail. As long as you retain this
> | notice you can do whatever you want with this stuff.
> | If we meet some day, and you think this stuff is worth it,
> | you can buy me a  in return. —㎝
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python

___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Michele Finelli

* Andrea D'Amore (and.dam...@gmail.com) [170907 13:35]:

[…]

La soluzione migliore passa per i set


Come:

   set('abcdefghijklmnopqrstuvwxyz') <= set(test_sentence)

?



non ci vuole anche un .lower() ?

--
  .*.finelli
  /V\
 (/ \) --
 (   )   Linux: Friends dont let friends use Piccolosoffice
 ^^-^^ --

Am'ar'c'mand, fe` pulid.
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Andrea D'Amore
2017-09-07 11:13 GMT+02:00 Pietro Brunetti :
> Una domanda carina (che mi hanno fatto) è scrivere una funzione che controlli 
> che in una frase ci siano tutte le lettere dell'alfabeto.
[…]
> La soluzione migliore passa per i set

Come:

set('abcdefghijklmnopqrstuvwxyz') <= set(test_sentence)

?

-- 
Andrea
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Francesco Maida
Ragazzi, mi dispiace ma io prendo la strada più lunga ma facilmente
comprensibile ;-)

https://gist.github.com/anonymous/0f30fdac699b9691f6ec282d6ec61042
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Federico Cerchiari
itertools.count() senza parametri o con solo un parametro è un generatore
infinito.
Usandolo dentro ad un generatore il risultato è un FizzBuzz infinito.

Il giorno 7 settembre 2017 11:25, Roberto Pomoni 
ha scritto:

> Perchè "itertools.count()" e non un semplice "range()"?
>
> Risparmio una riga di import, se lo scopo è scrivere meno codice
> possibile. :)
>
> Roberto
>
> "Difficilmente l'uomo fa uso delle libertà che lui ha, per esempio la
> libertà di pensiero; in compenso insiste a richiedere la libertà di parola"
> Søren Kierkegaard
>
> 2017-09-07 11:21 GMT+02:00 Federico Cerchiari  >:
>
>> ('FizzBuzz'[4*bool(n%3):4+4*bool(not n%5)] or n for n in
>> itertools.count())
>>
>> per quella delle lettere: set(frase) == set(list(map(chr, range(97,
>> 123
>>
>> p.s: itertools.count l'ho copiato da Carlo Miron :P
>>
>> Il giorno 7 settembre 2017 11:13, Pietro Brunetti 
>> ha scritto:
>>
>>> Una domanda carina (che mi hanno fatto) è scrivere una funzione che
>>> controlli che in una frase ci siano tutte le lettere dell'alfabeto.
>>>
>>> Comunque dovremmo davvero organizzare più spesso un po' di code-fu in
>>> lista
>>>
>>> SPOILER
>>> La soluzione migliore passa per i set
>>>
>>>
>>>
>>> Il giorno 7 settembre 2017 11:02, Carlo Miron  ha
>>> scritto:
>>>
 2017-09-07 0:58 GMT+02:00 Karim :

 > 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
 > :
 >>
 >> Nel primo caso per profili junior anni fa chiedevo tra le altre
 queste
 >> due:
 >> - quale linguaggi conosci di più e quanto bene da 1 a 10
 >> - fizzbuzz in che linguaggio preferisci
 >
 > Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
 > faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
 > diciamo che ha acceso gli animi :D

 E così parte il golfing sulla soluzione più breve. la mia è

 ("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))

 :P

 ㎝

 --
 |:**THE -WARE LICENSE** *(Revision ㊷)*:
 |  wrote this mail. As long as you retain this
 | notice you can do whatever you want with this stuff.
 | If we meet some day, and you think this stuff is worth it,
 | you can buy me a  in return. —㎝
 ___
 Python mailing list
 Python@lists.python.it
 https://lists.python.it/mailman/listinfo/python

>>>
>>>
>>>
>>> --
>>> There is a crack, a crack in everything. That’s how the light gets in
>>> L. Cohen
>>>
>>> ___
>>> Python mailing list
>>> Python@lists.python.it
>>> https://lists.python.it/mailman/listinfo/python
>>>
>>>
>>
>> ___
>> Python mailing list
>> Python@lists.python.it
>> https://lists.python.it/mailman/listinfo/python
>>
>>
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>
>
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Asyncio e DB

2017-09-07 Per discussione Lorenzo Mainardi
>
> > Provo anche a spostare il problema: è possibile gestire operazioni
> sincrone con ayncio?
>
> Certo, ma blocchi il loop.
>
> La via corretta’ e’ l’utilizzo di https://docs.python.org/3/
> library/asyncio-eventloop.html#asyncio.AbstractEventLoop.run_in_executor <
> https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.
> AbstractEventLoop.run_in_executor


Infatti, sono arrivato alla stessa conclusione.
Devo solo capire con precisione come farlo funzionare.


>
> Piu’ che una queue ti serve un task manager che gestisca la queue.
>
> Celery, PythonRQ o arq potrebbero fare al caso tuo.
>

Ci do un'occhiata.
Pensavo anche a huey che mi sembra piuttosto semplice.
L'unico punto è che non ho chiaro quale di queste task queue supporti
asyncio nativamente.

-- 
LORENZO MAINARDI
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Roberto Pomoni
Perchè "itertools.count()" e non un semplice "range()"?

Risparmio una riga di import, se lo scopo è scrivere meno codice possibile.
:)

Roberto

"Difficilmente l'uomo fa uso delle libertà che lui ha, per esempio la
libertà di pensiero; in compenso insiste a richiedere la libertà di parola"
Søren Kierkegaard

2017-09-07 11:21 GMT+02:00 Federico Cerchiari :

> ('FizzBuzz'[4*bool(n%3):4+4*bool(not n%5)] or n for n in
> itertools.count())
>
> per quella delle lettere: set(frase) == set(list(map(chr, range(97, 123
>
> p.s: itertools.count l'ho copiato da Carlo Miron :P
>
> Il giorno 7 settembre 2017 11:13, Pietro Brunetti 
> ha scritto:
>
>> Una domanda carina (che mi hanno fatto) è scrivere una funzione che
>> controlli che in una frase ci siano tutte le lettere dell'alfabeto.
>>
>> Comunque dovremmo davvero organizzare più spesso un po' di code-fu in
>> lista
>>
>> SPOILER
>> La soluzione migliore passa per i set
>>
>>
>>
>> Il giorno 7 settembre 2017 11:02, Carlo Miron  ha
>> scritto:
>>
>>> 2017-09-07 0:58 GMT+02:00 Karim :
>>>
>>> > 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
>>> > :
>>> >>
>>> >> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
>>> >> due:
>>> >> - quale linguaggi conosci di più e quanto bene da 1 a 10
>>> >> - fizzbuzz in che linguaggio preferisci
>>> >
>>> > Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
>>> > faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
>>> > diciamo che ha acceso gli animi :D
>>>
>>> E così parte il golfing sulla soluzione più breve. la mia è
>>>
>>> ("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))
>>>
>>> :P
>>>
>>> ㎝
>>>
>>> --
>>> |:**THE -WARE LICENSE** *(Revision ㊷)*:
>>> |  wrote this mail. As long as you retain this
>>> | notice you can do whatever you want with this stuff.
>>> | If we meet some day, and you think this stuff is worth it,
>>> | you can buy me a  in return. —㎝
>>> ___
>>> Python mailing list
>>> Python@lists.python.it
>>> https://lists.python.it/mailman/listinfo/python
>>>
>>
>>
>>
>> --
>> There is a crack, a crack in everything. That’s how the light gets in
>> L. Cohen
>>
>> ___
>> Python mailing list
>> Python@lists.python.it
>> https://lists.python.it/mailman/listinfo/python
>>
>>
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>
>
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Federico Cerchiari
('FizzBuzz'[4*bool(n%3):4+4*bool(not n%5)] or n for n in itertools.count())

per quella delle lettere: set(frase) == set(list(map(chr, range(97, 123

p.s: itertools.count l'ho copiato da Carlo Miron :P

Il giorno 7 settembre 2017 11:13, Pietro Brunetti  ha
scritto:

> Una domanda carina (che mi hanno fatto) è scrivere una funzione che
> controlli che in una frase ci siano tutte le lettere dell'alfabeto.
>
> Comunque dovremmo davvero organizzare più spesso un po' di code-fu in lista
>
> SPOILER
> La soluzione migliore passa per i set
>
>
>
> Il giorno 7 settembre 2017 11:02, Carlo Miron  ha
> scritto:
>
>> 2017-09-07 0:58 GMT+02:00 Karim :
>>
>> > 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
>> > :
>> >>
>> >> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
>> >> due:
>> >> - quale linguaggi conosci di più e quanto bene da 1 a 10
>> >> - fizzbuzz in che linguaggio preferisci
>> >
>> > Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
>> > faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
>> > diciamo che ha acceso gli animi :D
>>
>> E così parte il golfing sulla soluzione più breve. la mia è
>>
>> ("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))
>>
>> :P
>>
>> ㎝
>>
>> --
>> |:**THE -WARE LICENSE** *(Revision ㊷)*:
>> |  wrote this mail. As long as you retain this
>> | notice you can do whatever you want with this stuff.
>> | If we meet some day, and you think this stuff is worth it,
>> | you can buy me a  in return. —㎝
>> ___
>> Python mailing list
>> Python@lists.python.it
>> https://lists.python.it/mailman/listinfo/python
>>
>
>
>
> --
> There is a crack, a crack in everything. That’s how the light gets in
> L. Cohen
>
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>
>
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Pietro Brunetti
Una domanda carina (che mi hanno fatto) è scrivere una funzione che
controlli che in una frase ci siano tutte le lettere dell'alfabeto.

Comunque dovremmo davvero organizzare più spesso un po' di code-fu in lista

SPOILER
La soluzione migliore passa per i set



Il giorno 7 settembre 2017 11:02, Carlo Miron  ha scritto:

> 2017-09-07 0:58 GMT+02:00 Karim :
>
> > 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
> > :
> >>
> >> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
> >> due:
> >> - quale linguaggi conosci di più e quanto bene da 1 a 10
> >> - fizzbuzz in che linguaggio preferisci
> >
> > Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
> > faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
> > diciamo che ha acceso gli animi :D
>
> E così parte il golfing sulla soluzione più breve. la mia è
>
> ("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))
>
> :P
>
> ㎝
>
> --
> |:**THE -WARE LICENSE** *(Revision ㊷)*:
> |  wrote this mail. As long as you retain this
> | notice you can do whatever you want with this stuff.
> | If we meet some day, and you think this stuff is worth it,
> | you can buy me a  in return. —㎝
> ___
> Python mailing list
> Python@lists.python.it
> https://lists.python.it/mailman/listinfo/python
>



-- 
There is a crack, a crack in everything. That’s how the light gets in
L. Cohen
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] Interview per lavoro su python (e django)

2017-09-07 Per discussione Carlo Miron
2017-09-07 0:58 GMT+02:00 Karim :

> 2017-09-06 8:25 GMT+10:00 Riccardo Magliocchetti
> :
>>
>> Nel primo caso per profili junior anni fa chiedevo tra le altre queste
>> due:
>> - quale linguaggi conosci di più e quanto bene da 1 a 10
>> - fizzbuzz in che linguaggio preferisci
>
> Fantastico, non conoscevo fizzbuzz. Ho provato a farlo e ho salvato la
> faccia, allora ho proposto lo stesso esercizio sul gruppo facebook...
> diciamo che ha acceso gli animi :D

E così parte il golfing sulla soluzione più breve. la mia è

("Fizz"*(not x%3)+"Buzz"*(not x%5) or x for x in itertools.count(1))

:P

㎝

-- 
|:**THE -WARE LICENSE** *(Revision ㊷)*:
|  wrote this mail. As long as you retain this
| notice you can do whatever you want with this stuff.
| If we meet some day, and you think this stuff is worth it,
| you can buy me a  in return. —㎝
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python