diff options
Diffstat (limited to 'challenge-031/paulo-custodio/python/ch-2.py')
| -rw-r--r-- | challenge-031/paulo-custodio/python/ch-2.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-031/paulo-custodio/python/ch-2.py b/challenge-031/paulo-custodio/python/ch-2.py new file mode 100644 index 0000000000..eb5675143d --- /dev/null +++ b/challenge-031/paulo-custodio/python/ch-2.py @@ -0,0 +1,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]]) |
