What is the wrong with my python code_ very beginner question?

1941 views python
2

#!/usr/bin/env python3

class Test: 

    note = 10 

if note >= 10:
            print("yes")
    else:
            print("NO")

The output is:

env: /Users/mac/Downloads/Ex_Files_Python_EssT/Test.py: 
Permission denied

Why I have got this message?

answered question

Exactly what did you do to run this code?

2 Answers

12

Make the python file executable

chmod +x Test.py

posted this
13

Why do you have to include the logic inside a class?

note = 10

if note >= 10: print("yes") else: print("NO")

Just this will do, remove the class

posted this

Have an answer?

JD

Please login first before posting an answer.