Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python beginner: Weird Syntax Error
#1
Hello to all.

I need a quick and easy fix for my problem with Python error.

I'm just beginning coding, and I'm a little bit frustrated because it seems like error is not in my code (which is pretty pretty simple) but in the Python version number?

I tried reinstalling, putting Python on another computer (same error on Windows 7 32-bit, Windows 10 64-bit, same problem).

Tried with web-based and exe versions, the problems still exists.

Please, anyone?

İmage
buran wrote Oct-12-2017, 08:07 PM:
Don't post images, but code in code tags
Quote
#2
I can't see why you get that error either. Code, looks fine. Usually, Python errors come with more detail, so I'm not convinced it is from CPython.

Have you tried putting the statements into to a file and executing that from PowerShell command line?

How come the 6 in Python 3.6.3 is highlighted in red?
I only use Python 3 (except where stated otherwise)
If you are not confused, you are misinformed
Quote
#3
I don't know either. Number 6 goes red when I try to execute code with F5 in IDLE.

It doesn't work in cmd nor PS.

I'm totally confused.

İmage
Quote
#4
that is because you did copy/paste in your file zadatak_4.py everything from the python interactive prompt. that is wrong. read this https://python-forum.io/Thread-Basic-How...ython-code

your file should have only this in it:
 
a = float(input("Unesite prvi broj:"))
b = float(input("Unesite drugi broj:"))
c = a + b
print(c)
everything else is from the python interactive prompt and should not be in the file. Then you can run it with F5
sparkz_alot likes this post
Quote
#5
Oh my god. You're totally right while I'm a little ashamed now :/

Thank you very much, and sorry for the images. Didn't know :/
Quote
#6
(Oct-12-2017, 08:16 PM)mentoly Wrote: Oh my god. You're totally right while I'm a little ashamed now :/

Thank you very much, and sorry for the images. Didn't know :/
Ha ha.

You are not the only one feeling dumb, I didn't pick up what you were doing either. I've never used IDLE, so didn't realise you were not in the console.
I only use Python 3 (except where stated otherwise)
If you are not confused, you are misinformed
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Beginner willianramos 4 70 Oct-13-2017, 07:36 PM
Last Post: willianramos
  Beginner Help request: Calculator JinLee 5 135 Sep-20-2017, 08:21 PM
Last Post: nilamo
  ere iam getting the unicodec codescope error syntax error how can i resolve it? srinivas135 4 108 Sep-12-2017, 03:38 PM
Last Post: snippsat
  What is causing the syntax error? Mr_Keystrokes 5 136 Sep-12-2017, 03:12 PM
Last Post: wavic
  Unknown Syntax Error AlwaysNew 6 113 Sep-09-2017, 01:57 AM
Last Post: AlwaysNew
  Beginner needs help Waelrt 1 105 Aug-19-2017, 10:29 AM
Last Post: hbknjr
  Simple syntax error help paulmj7 4 139 Aug-02-2017, 09:56 AM
Last Post: buran
  Beginner needing help! Franco 2 96 Jul-29-2017, 12:56 PM
Last Post: Franco
  Q: why do I get syntax error dondon 3 105 Jul-28-2017, 04:11 PM
Last Post: dondon
  problem with syntax error jobemorgan 3 138 Jul-26-2017, 08:02 PM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)