Python Forum
Question re: running code in Editor (i.e. Atom) vs Python interpreter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question re: running code in Editor (i.e. Atom) vs Python interpreter
#1
Python3

New coder

Prompt:

Write a program which prompts the user for a Celsius temperature, convert the temperature to Fahrenheit, and print out the converted temperature.

Question:

When I attempted to solve the following problem in the interpreter, it results in the following:

ctemp = input('Enter Celsius Temperature') \
... ftemp = float(ctemp) * (9 / 5) + 32 \
File "<stdin>", line 2
ftemp = float(ctemp) * (9 / 5) + 32 \
^
SyntaxError: invalid syntax


However, when I enter the same code in the Atom editor, no error occurs and the program runs with the correct answer.

My understanding is that aside from the pro's vs con's between using an editor vs. the interpreter, the Python rules (including syntax) are the same between an editor such as Atom and the interpreter.

Can you please examine my code to explain what I've missed?

Thank you everyone in advance for your help.
Reply


Messages In This Thread
Question re: running code in Editor (i.e. Atom) vs Python interpreter - by rok - Jun-29-2020, 07:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 634 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 381 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 992 Nov-15-2023, 06:56 PM
Last Post: jst
  the order of running code in a decorator function akbarza 2 519 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Mac default python interpreter Viewpoint8455 2 910 Oct-13-2022, 06:25 AM
Last Post: perfringo
  How to expand and collapse individual parts of the code in Atom Lora 2 1,148 Oct-06-2022, 07:32 AM
Last Post: Lora
  Folding in ATOM XavierPlatinum 5 1,211 Sep-11-2022, 09:21 PM
Last Post: XavierPlatinum
  Code running many times nad not just one? korenron 4 1,356 Jul-24-2022, 08:12 AM
Last Post: korenron
  Error while running code on VSC maiya 4 3,722 Jul-01-2022, 02:51 PM
Last Post: maiya
  Sublime Text Editor not recognizing Python elroberto 5 2,867 Jun-13-2022, 04:00 PM
Last Post: rob101

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020