Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simple calculator
#5
(Jul-22-2018, 11:35 PM)Larz60+ Wrote:
Error:
File "/run/media/Larz60p/Data-4TB/python/e-h/f/forum/a-f/calc/src/junk1.py", line 23 print'Invalid' ^ SyntaxError: invalid syntax
This is why it is important to provide all information necessary to determine what is wrong.
You have a syntax error, the script never ran.
change line 23
# From:
 print'Invalid'
# To:
    print('Invalid')
make sure your indentation is 4 spaces. That's important
I'm not getting an error, when it tells me to put in two numbers it goes instantly to the else line and prints 'invalid'. It does not perform the calculation.
Reply


Messages In This Thread
simple calculator - by shakeelthomas - Jul-22-2018, 10:24 PM
RE: simple calculator - by Larz60+ - Jul-22-2018, 11:18 PM
RE: simple calculator - by shakeelthomas - Jul-22-2018, 11:28 PM
RE: simple calculator - by Larz60+ - Jul-22-2018, 11:35 PM
RE: simple calculator - by shakeelthomas - Jul-22-2018, 11:44 PM
RE: simple calculator - by ichabod801 - Jul-23-2018, 12:37 AM
RE: simple calculator - by shakeelthomas - Jul-23-2018, 01:13 AM
RE: simple calculator - by ichabod801 - Jul-23-2018, 03:17 AM
RE: simple calculator - by shakeelthomas - Jul-23-2018, 03:45 AM
RE: simple calculator - by Larz60+ - Jul-23-2018, 03:53 AM
RE: simple calculator - by buran - Jul-23-2018, 04:17 AM
RE: simple calculator - by shakeelthomas - Jul-23-2018, 10:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple calculator ryza 3 1,189 Sep-21-2022, 04:42 PM
Last Post: deanhystad
  Simple Distance Between Points Calculator Spade 1 1,781 Sep-17-2021, 03:14 PM
Last Post: DeaD_EyE
  Printing simple calculator answer LCFC2020 2 2,223 Dec-05-2020, 02:07 PM
Last Post: MK_CodingSpace

Forum Jump:

User Panel Messages

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