Skip to content

Instantly share code, notes, and snippets.

@umitkacar
Last active August 6, 2021 12:24
Show Gist options
  • Save umitkacar/d94ae5204c82c14515b675535c55f131 to your computer and use it in GitHub Desktop.
Save umitkacar/d94ae5204c82c14515b675535c55f131 to your computer and use it in GitHub Desktop.
class A:
out1 = 2
out2 = 3
out3 = 4
a = {}
for i in range(1,4):
a[f'out{i}'] = getattr(A,f'out{i}')
print(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment