Skip to main content
deleted 9 characters in body
Source Link
Fredrick Brennan
  • 7.4k
  • 3
  • 35
  • 67

In Python this is acheived with try...except. In your case, you probably want to catch NameError.

try: list[0]L[0] except NameError: listL = ["Example",2] list[0]L[0] 

In Python this is acheived with try...except. In your case, you probably want to catch NameError.

try: list[0] except NameError: list = ["Example",2] list[0] 

In Python this is acheived with try...except. In your case, you probably want to catch NameError.

try: L[0] except NameError: L = ["Example",2] L[0] 
Source Link
Fredrick Brennan
  • 7.4k
  • 3
  • 35
  • 67

In Python this is acheived with try...except. In your case, you probably want to catch NameError.

try: list[0] except NameError: list = ["Example",2] list[0]