PythonエラーTypeError:「set」オブジェクトは添え字化できません



Python Error Typeerror



Pthyonの学習段階で、出力リストを反復処理すると、コレクションオブジェクトが作成され、このBUGが表示されました(オブジェクトを作成するときに、()を()として記述します)
エラーの場合は次のとおりです。

#Created collection names = {'Your uncle','Your Second Uncle','Your Big Three'} ages = {18,19,20,21} jobs = {'teacher','programmer','Soy Sauce'} for i in range(3): print('Name: {0}, age: {1}, work: {2}'.format(names[i],ages[i],jobs[i])) #TypeError: 'set' object is not subscriptable # Indicates that the collection object without subscript operation is used as an object[i]

正しいケースは次のとおりです。



names1 = ('Your uncle','Your Second Uncle','Your Big Three') ages1 = (18,19,20,21) jobs1 = ('teacher','programmer','Soy Sauce') for i in range(3): print('Name: {0}, age: {1}, work: {2}'.format(names1[i],ages1[i],jobs1[i]))

初心者、アドバイスしてください〜