I'm just starting out with Python and following a guide to learn functions and modules.
I think I've done everything correctly here but I can't explain the syntax error for the getcontext command.
Any help is appreciated.
This worked fine for me: (Python 3.6.8)
from decimal import getcontext numberofdigits = int(input("Num of digits:")) getcontext().prec = numberofdigits print(getcontext())
Since your screenshot is cut off on the right, I'm wondering if there is something wrong in your "input" line?
Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!