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. Calculator problem ¯\_(ツ)_/¯ stykus1992 0 47 Feb-15-2018, 11:01 AM
Last Post: stykus1992
  Very beginner needs help bostltch 3 95 Feb-04-2018, 12:17 AM
Last Post: Larz60+
  Beginner trying to run simple code joebone 6 105 Feb-02-2018, 09:35 PM
Last Post: joebone
  beginner level Python:- output XLS spreadsheet instead of using tabulate haziebaby 7 135 Jan-27-2018, 09:52 PM
Last Post: snippsat
  Need some beginner Module help... Alimdor 2 78 Jan-27-2018, 04:05 AM
Last Post: Alimdor
  python nested list assignment weird behavior eyalk1 2 129 Jan-16-2018, 07:32 PM
Last Post: wavic
  syntax error? Culm 2 99 Jan-13-2018, 07:03 PM
Last Post: wavic
  Syntax Error in Program bijay1983 2 116 Dec-24-2017, 05:36 PM
Last Post: squenson
  NEWBIE error regarding syntax rohitn12 1 96 Dec-19-2017, 10:19 PM
Last Post: micseydel
  Learning python specific syntax after using other scripting languages for years Arcs 12 412 Dec-13-2017, 07:18 PM
Last Post: Arcs

Forum Jump:


Users browsing this thread: 2 Guest(s)