I have 10 check-boxes and to check whether the checkbox is checked or not, I was trying to use loop. tacb1
is the name of the 1st checkbox, tacb2
is the name of 2nd checkbox and so on. I want to use a loop which looks something like:
for i in range(1,11):
if self.tacb'"+i+"'isChecked() == True:
print("hi")
else:
print("bye")
It is throwing the error for the line self.tacb'"+i+"'isChecked()
as invalid syntax. How to concatenate a variable with self
?