diff --git a/README.md b/README.md index fa0237d..411d3d3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # OpenBootCampPython Repository to store Python boot camp. + +* Exercise 2: Modifica la variable del anterior ejercicio en la consola de python y después muestrala por consola para ver la modificación de la variable. Tienes que subir capturas de pantalla en una carpeta comprimida zip. + + * Screenshot in folder "src/ExerciseTwo/ejercicio2.png" on branch ExerciseTwo. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ee2bf11 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-i https://pypi.org/simple +setuptools==65.5.0 ; python_version >= '3.7' +wheel==0.38.0 diff --git a/src/exercisetwo/ejercicio2.png b/src/exercisetwo/ejercicio2.png new file mode 100644 index 0000000..890b172 Binary files /dev/null and b/src/exercisetwo/ejercicio2.png differ diff --git a/src/exercisetwo/helloworld.py b/src/exercisetwo/helloworld.py new file mode 100644 index 0000000..c1834c1 --- /dev/null +++ b/src/exercisetwo/helloworld.py @@ -0,0 +1,8 @@ +def helloworld(a='Hola mundo!'): + """Script that show in terminal the variable a + :param a: parameter to show in terminal, default to 'Hola mundo!' + :type a: str + :return: None + :rtype: NoneType + """ + print(a) diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..85ba712 --- /dev/null +++ b/src/main.py @@ -0,0 +1,19 @@ +import sys +from src.exercisetwo.helloworld import helloworld + + +def main(argv): + """Main script for exercise two + :param argv: list of arguments for helloworld script + :type argv: list(str) + :return: None + :rtype: NoneType + """ + if len(argv) == 0: + helloworld() + else: + helloworld(argv[0]) + + +if __name__ == '__main__': + main(sys.argv[1:])