From 477b8d5e9820e4f8d5f68e4663c6d7e39864ae81 Mon Sep 17 00:00:00 2001 From: jelambrar Date: Thu, 24 Oct 2019 22:54:15 -0500 Subject: [PATCH 1/2] for enumerate --- tips/python_forEnumerate.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tips/python_forEnumerate.md diff --git a/tips/python_forEnumerate.md b/tips/python_forEnumerate.md new file mode 100644 index 0000000..c49240a --- /dev/null +++ b/tips/python_forEnumerate.md @@ -0,0 +1,2 @@ +#Python #PY #Programming #Hacktoberfest +Si necesitas tener una copia y el índice de cada elemento de una lista, puedes utilizar el comando **enumerate**. Ej: `for i, item in enumerate(my_list)` From cdde650d304657a5aa7e810ef8f6a0a94a536266 Mon Sep 17 00:00:00 2001 From: jelambrar Date: Fri, 25 Oct 2019 22:16:30 -0500 Subject: [PATCH 2/2] if __name__ == __main__ python --- tips/python_mainPython.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tips/python_mainPython.md diff --git a/tips/python_mainPython.md b/tips/python_mainPython.md new file mode 100644 index 0000000..66e728f --- /dev/null +++ b/tips/python_mainPython.md @@ -0,0 +1,2 @@ +#Python #PY #Programming #Hacktoberfest +Para que una surrutina no se ejecute cuando tu archivo python es llamado por otro fichero python, escribela después de `if __name__ == '__main__':`