aboutsummaryrefslogtreecommitdiff
path: root/challenge-031/paulo-custodio/python/ch-2.py
blob: eb5675143df0eba6fc51d839631f3fac6e7bc52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python3

# Challenge 031
#
# Task #2
# Create a script to demonstrate creating dynamic variable name, assign a value
# to the variable and finally print the variable. The variable name would be
# passed as command line argument.

import sys

globals()[sys.argv[1]] = 10
print(globals()[sys.argv[1]])