I’m doing some classes in Coursera, one of their labs says I can type a line of code in python(3), “sys.float_info” but without the quotations, and the line should make python give me info, when I type that into Jupiter’s practice screen it gives me an error code that it’s not a command?
What ‘practice screen’? What exactly is the error? In general it is always good to report in your post the full error you are given verbatim, and in fact, it is not uncommon for those helping you to expect the full traceback be provided. In this case that is probably not necessary.
If you haven’t checked it out already I suggest you read Getting good answers to your questions. At the bottom it also references a good guide from StackOverflow to creating posts like these How do I ask a good question?. Even though that is for a different forum much of that would be pertinent to your type of post. I also suggest looking at similar posts with good engagement to see what is expected.
With covering why it is hard to address exactly what you mean at this time aside…
I suspect you meant to try the following in a Jupyter notebook cell?
import sys
print(sys.float_info)
When I run that in cell in a new notebook in a temporary JupyterLab session on a remote computer launched from clicking the ‘launch binder
’ badge here, I see the following output upon cell execution:
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
One concern I had when I saw your post refer to ‘Jupiter’s [sic] practice’, was that maybe you meant JupyterLite that you’ll get if you go to the ‘Try Jupyter’ page and click on the top ‘JupyterLab’ tile. You’ll note just above that tile that JupyterLite is Experimental and so you should be cautious about using it extensively. (The link I gave you above has a session with full JupyterLab backed by a true Python-based ipykernel-based kernel. JupyterLite uses a pyodide-based kernel that still has differences at this time.)
However, on my machine I just tried that in JupyterLite and see the following output:
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
That doesn’t necessarily mean it will work on your machine though. I’m using Chrome running on a Mac for that JupyterLite test. I don’t know if different browsers and systems might not work as I haven’t tried this exhaustively in all contexts. For example, maybe it doesn’t work in JupyterLite in Firefox for some reason? Or doesn’t work on Chromebook machines since it is relying on the system to some extent? I don’t know. Python’s sys
module allows you in theory to work with your system, however, that may have system-specific issues and/or limitations.
Finally, you should be contacting your class administrators first, and foremost, if things are not working as they have instructed.