p, or when you can take advantage
of set operations, like union or symmetric difference.
If your list of chickens is unordered and has no duplicates,
using a set instead is often a good refinement.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.
uot;SuperLion", "Cow", "Panda"]
You can perform the whole operation with a single list
comprehension.
animals_lol = [[a, len(a)] for a in animals]
Which is shorthand for the following loop:
animals_lol = []
for a in animals:
animals_lol.append([a, len(a)])
--
Ne
On 2018-06-13, Niharika Jakhar wrote:
> hi everyone!
> I am working with a tsv file which has NA and empty values.
> I have used csv package to make a list of list of the data.
> I want to remove NA and empty values.
Should the the data 40 50 NA 12 mean the same thing as 40 50 1
l the apostrophes and dashes, both
of which could be considered parts of words.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
re might in fact be
> some behaviour that these login records might acquire within
> the system. For example formatted printing, comparisons between
> records etc etc.
Excellent point! At the very least, such classes usually gain the
ability to build themselves with an __init__ method, wh
ir atomic weights, and the total
> molecular weight.
>
> Convert between temperature scales (degrees Celsius, Fahrenheit, and
> Kelvin).
Excellent suggestions.
It could also be fun to build a text-based solitaire program of
your choice.
--
Neil Cerutti
___
On 2018-04-13, David Rock <da...@graniteweb.com> wrote:
>
>> On Apr 13, 2018, at 09:24, Neil Cerutti <ne...@norwich.edu> wrote:
>>
>> On 2018-04-12, Scharrer, Brianna <bschar...@luc.edu> wrote:
>>> Applications of basic language syntax
>&g
nteger (as Alan
discussed) I recommend using a dictionaries for conversion,
rather than if statements, if you're allowed.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 2018-03-30, Stefan Behnel <stefan...@behnel.de> wrote:
> Neil Cerutti schrieb am 30.03.2018 um 15:50:
>> On 2018-03-30, Stefan Behnel wrote:
>>> I admit that I'm being a bit strict here, there are certainly
>>> cases where parsing the namespace from a tag i
o that, it's worth reconsidering (or
> asking) if you are doing the right thing.
Namespaces hurt my head when I try to imagine a use for them. The
only one's I've encountered are just applied to an entire
document, making parsing more inconvenient but providing no other
benefit I can s
has to be changed into well-formed?
That's sounds like a fun and challenging problem.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
finite representations in
decimal notation.
For your specific problem, you can use Python's format function,
for example:
>>> for i in range(1, 11):
print('{:.4f}'.format(1 / i))
1.
0.5000
0.
0.2500
0.2000
0.1667
0.1429
0.1250
0.
0.1000
--
Neil Cerutti
__
ects cannot exist independently of their
parent. In other words, in the text aggregation is a
generlisation of composition.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
liminate the verbatim
repetition of code.
def get_query():
return input("Please type in your question(press 'Enter' to exit):")
In main:
query = get_query()
while query!='':
oracle()
count += 1
query = get_query()
You can generalize
On 2017-10-19, Alan Gauld via Tutor <tutor@python.org> wrote:
> On 18/10/17 21:09, Albert-Jan Roskam wrote:
>>
>> On Oct 16, 2017 15:12, Neil Cerutti <ne...@norwich.edu> wrote:
>
>>> sqlite3 module. In sqlite modifying table definitions is limited
>>
to use. Your main goal,
at first, should be to stick with standard SQL as much as you
possibly can, to make it easier to switch database engines should
you ever wish to do so.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or ch
ious ways of doing things.
Sometimes I use classes simply because it provides a convenient
way to organize the project's functions.
This crops up sometimes when I'm translating some data into
another form. Every object translates into itself.
--
Neil Cerutti
___
On 2017-08-16, boB Stepp <robertvst...@gmail.com> wrote:
> On Tue, Aug 15, 2017 at 12:29 PM, Alan Gauld via Tutor
> <tutor@python.org> wrote:
>> On 15/08/17 15:09, Neil Cerutti wrote:
>>>> There are a variety of reports that I would like to be able
>&
area for me, but I see no reason why my
> two dictionaries cannot be manipulated to pull the desired
> results for each imagined type of report.
You really can do it, but to me this requirement argues for going
back to a database backend. Why rewrite SQL?
--
Neil Cerutti
return "Celsius"
> ... return "unknown"
> ...
>>>> check("c")
> 'Celsius'
>>>> check("C")
> 'Celsius'
>>>> check("F")
> 'unknown'
>
> Fine so far. But now:
>
>>>>
ngs-in-strings
> cases.
Composing a FSA (finite state automata) by hand would be an
excellent exercise in addition to covering the overlapping cases.
Another fun exercise might be to find the bithdays using
arithmetic operations instead of string operations.
--
Neil Cerutti
__
s with small,
easy-to-think-about test cases, and slowly build them up.
Do not try to debug by starting with a typical case.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
on range objects.
x[::10]
range(0, 100, 10)
So we've got *that* going for us.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
is a
major failure.
I'm living in the past, man!
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
are
using to read this mailing list, or at least to change your
assumption when you see a contentless message from Original
poster didn't send email to I can't see the email.
This is also a USENET newsgroup, where attachements are not a
thing.
--
Neil Cerutti
on it. If not, it's just inviting needless headaches.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
of your algorithm adjusted
accordingly.
--
Neil Cerutti
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
27 matches
Mail list logo