python if variabl is list
from collections import UserList
regular_list = [1, 2, 3, 4, 5]
user_list = [6, 7, 8, 9, 10]
# Checks if the variable "a_list" is a list
if isinstance(regular_list, list):
print("'regular_list' is a list.")
else:
print("'regular_list' is not a list.")
# Checks if the variable "a_string" is a list
if isinstance(user_list, list):
print("'user_list' is a list.")
else:
print("'user_list' is not a list.")