KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is it possible to declare a variable in Python, like so?: var so that it initialized to None? It seems like Python allows this, but as soon as you access it, it crashes. Is this possible? If not, why? EDIT: I want to do this for cases like this: value for index in sequence: if value == None and conditionMet: value = index break Related Questions Why can a function modify some arguments as perceived by the caller, but not others? Python Variable Declaration See Also Python Names and Values Other languages have "variables"
Tags (comma-separated)
Save Edits
Cancel