1
0
Fork 0
Python2017/labs05/task03.py

24 lines
498 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""** zad. 3 **
Przekształć rozwiązanie zadania drugiego w taki sposob, żeby korzystało z biblioteki ``argparse``
zamiast z z listy ``sys.argv``."""
import task00
import argparse
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument("float", help="liczby zmiennoprzecinkowe", nargs = '+')
args = parser.parse_args()
liczby = args.float
print(task00.suma(liczby))
# print(task00.suma(sys.argv[1:]))
if __name__ == "__main__":
main()