I am new in the forum, also python programming and trying to learn it. I confused the the part code given below. It is simple but when I want to use "compare_2_data" or "compare_3_data" out of "if statement", the compiler says "compare_1_data" is not defined. But I can see the value of this variable when I put "print (compare_1_data)" inside if statement.
- Code: Select all
if startReading_1 !=-1:
data_text_3 = data_text_1[text_1_counter].split(' ')
compare_1_data = data_text_3 
compare_3_data = data_text_3 
Can anyone help me to solve this problem?