How come nothing in Python works?

How come nothing in Python works?

from __future__ import print_function
def fps_to_ms(fps):
return Decimal(1) / Decimal(fps) * Decimal(1000)
print(fps_to_ms(60))
^
SyntaxError: invalid syntax
from __future__ import print_function
def fps_to_ms(fps):
return Decimal(1) / Decimal(fps) * Decimal(1000)
print fps_to_ms(60)
^
SyntaxError: invalid syntax
from __future__ import print_function
def fps_to_ms(fps):
return Decimal(1) / Decimal(fps) * Decimal(1000)
placeholder = fps_to_ms(60)
^
SyntaxError: invalid syntax

Do your own homework.

use python 3, this it's not year 1990

ur tabs look retarded and ur shits all gay

maybe bad indentation? use 4 spaces

I already used 1 space, 2 spaces, 4 spaces, a tab. It keeps just saying "SyntaxError: invalid syntax" when I try to call the function.

ok got it: REPL requires 1 empty line after block

Ok thanks. Weird design but what can you do.

>mfw trying to handle preloaded file paths with \ in them

python is not a real programming language, just a little scripting toy for sysadmins

?

Its a real language commonly used for easy things

I use C++ but I need a tool for quick calculations (with one or more variables) that I can do on the fly in command prompt. Python seems good for that job.

Pretty sure it's used for lots of things, for us everything from tooling to a variety of things, even something that manages multiple data centers, parts for data science, deployment, etc.

?
Path(p.replace('\', ''))

or are they escaped multiple times?

try:
OPs_parents == proud_of_their_son
except:
print("cannot assign variable proud_of_their_son to OPs_parents")

Do you guys think an error was throw here? I sure do

go fuck yourself 90% of code is still in 2.7

>==
>assign

should I be a c++ programmer, I kinda like the language in school rn and I'm gradding in 9 months.

This was true 5 years ago. It's not true today. Reminder there is only two years left until 2.7 is official deprecated and abandoned by the Python foundation.

Oh sorry it's 89% now not 90%. If you think python 2 will be deprecated before python 3 you live in a bubble.

refer the thread poster to a book "how to program"