Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1801

+= HELP

by Planet - 22 February, 2021 - 12:56 PM
This post is by a banned member (Planet) - Unhide
Planet  
Heaven
2.537
Posts
829
Threads
4 Years of service
#1
Ok so Im quite ew to python and my code looks like this
 
Code:
counter = 1


def question():
     #some code here
     counter += 1

and I get an error saying that counter is not defined that vanishes when I do counetr = counter + 1 but I guess that counter += 1 is more efficient, any thoughts?
This post is by a banned member (Snake1337) - Unhide
Snake1337  
Godlike
2.351
Posts
317
Threads
5 Years of service
#2
the difference is negligible , their speed is almost identical so doesn't matter which ever u choose
[Image: 7xibycc.jpg]


Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)