I'm new to python and for the second day following an MIT course
<https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/resources/lecture-2-branching-and-iteration/>,
when I use the following codes from the example py files provided, it
encounters error and it had to be restarted to be used again.
The codes are as follows:
*First one which crashes it is:*
text = input("Type anything... ")
print(5*text)
num = int(input("Type a number... "))
print(5*num)
*This one crashes it too:*
x = float(input("Enter a number for x: "))
y = float(input("Enter a number for y: "))
if x == y: print("x and y are equal")
if y != 0: print("therefore, x / y is", x/y)
elif x < y: print("x is smaller")
elif x > y: print("y is smaller") print("thanks!")
Mistake details are as follows:
Traceback (most recent call last): File
"/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/base_frontend_mixin.py",
line 138, in _dispatch handler(msg) File
"/home/fakamaz/anaconda3/lib/python3.9/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py",
line 278, in _handle_input_request return super(DebuggingWidget,
self)._handle_input_request(msg) File
"/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/frontend_widget.py",
line 512, in _handle_input_request self._readline(msg['content']['prompt'],
callback=callback, password=msg['content']['password']) File
"/home/fakamaz/anaconda3/lib/python3.9/site-packages/qtconsole/console_widget.py",
line 2422, in _readline self._show_prompt(prompt, newline=False,
separator=False) TypeError: _show_prompt() got an unexpected keyword
argument 'separator'
Interesting enough, when I try to run the code on my friends Windows PC -
it works for a certain extend, but not completely. For instance it let you
enter number or word, but do not "print' it later on...
On my Linux PC - it produces an error as above all the time...
So what gives? Did I break Spyder? :)
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/spyderlib/53cfcf7d-18bc-4174-9961-9cc955512cdfn%40googlegroups.com.