[Edu-sig] Re: back to school... "1/3" --> float question, just eval?

2020-04-09 Thread Wes Turner
Are there unit tests for the supported operations? Is the UI logic a separate testable unit? Does it just fatal exception when parsing fails; or does the REPL loop catch the e.g. Value error? Instead of a CLI eval wrapper with regex, you could use ipywidgets in a notebook:

[Edu-sig] Re: back to school... "1/3" --> float question, just eval?

2020-04-09 Thread kirby urner
> > > Try the following: > > from fractions import Fraction > float(Fraction("1/3")) > > Knowing you, I'm sure you can figure out plenty of useful applications of > this. :-) > > André > > A totally excellent suggestion! I'm going to share that, by bringing campers here on tour, saying "this is

[Edu-sig] Re: back to school... "1/3" --> float question, just eval?

2020-04-09 Thread André Roberge
On Thu, Apr 9, 2020 at 2:02 PM kirby urner wrote: > Here's a thread I'm starting with my campers taking a PyCamp course. > > Yesterday we were co-evolving a calculator driven by looping menu. It > does squares and square roots (one of the campers supplied this logic) and > I was just getting

[Edu-sig] back to school... "1/3" --> float question, just eval?

2020-04-09 Thread kirby urner
Here's a thread I'm starting with my campers taking a PyCamp course. Yesterday we were co-evolving a calculator driven by looping menu. It does squares and square roots (one of the campers supplied this logic) and I was just getting around to introducing the y^x key as some call it, i.e. any