Hello, Heres another newbie python question: How can I loop through some data and assign different variables with each loop
So this is my original code: def BeamInfo(x): for Bnum in x: if plan1.IonBeamSequence[Bnum].ScanMode == 'MODULATED': TxTableAngle = plan1.IonBeamSequence[Bnum].IonControlPointSequence[0].PatientSupportAngle print(TxTableAngle) else: None BeamInfo([0,1,2,3,4,5,6]) Ideally what I want is this: when Bnum is 0, then "TxTableAngle" will be appended with "_0" (eg.TxTableAngle_0). When Bnum is 1 then TxTableAngle_1, etc. How do I do this in python? Thanks -Fuz _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor