From f0ac63955c3875e0325c4328cdc6cdb53ca57b2f Mon Sep 17 00:00:00 2001 From: Rolando Scarfullery <74724935+hexbreak@users.noreply.github.com> Date: Sun, 7 Feb 2021 00:29:57 -0500 Subject: [PATCH 001/165] Update README.md Edit for better grammar in sentences, structure, errors. --- exercises/04-Call-a-function/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index cbf2ccd..a1a6563 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" # `04` Calling a function -A function could receive 0 parameters, and you can it always returns something, event if you don't explicitly add the `return` statement. +A function could receive zero parameters, and it always returns something, even if you don't explicitly add the `return` statement. :point_up: [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python) @@ -15,7 +15,7 @@ def calculate_area(length, edge): return length * edge ``` -If you want to use that function to calculate the area of a square with +If you want to use that function to calculate the area of a square with: ```python length = 3 @@ -30,7 +30,7 @@ area = calculate_area(3,6) # 📝 Instructions: -Create a new variables named square_area1, square_area2, square_area3 and call the function calculate_area 3 times one fo each square in the picture, for example: +Create a new variables named square_area1, square_area2, square_area3 and call the function calculate_area three times one for each square in the picture, for example: ```python # For the first figure: @@ -41,7 +41,7 @@ square_area1 = calculate_area(4,4) # 💡 Hint: -Call the `calculate_area` function 3 times, one per each square, passing the length and edge of each square. +Call the `calculate_area` function three times, one per each square, passing the length and edge of each square. :tv: [9 min video about functions in python](https://www.youtube.com/watch?v=NE97ylAnrz4) From c5f9a89b108c1969e14b102511b302155a98a61a Mon Sep 17 00:00:00 2001 From: Rolando Scarfullery <74724935+hexbreak@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:26:41 -0500 Subject: [PATCH 002/165] Update README.md Fixed for a clearer explanation. --- exercises/05-Defining-vs-Calling-a-function/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index 771ec35..e81637d 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=fz4ttmwZWuc" # `05` Defining vs Calling a function -Functions will only exists if you or somebody else defines them... is the only way the language compiler/interpreter knows they exist, therefore is able to run them when you call them. +Functions will only exists if you or somebody else defines them... it is the only way the language compiler/interpreter knows they exist, therefore it's able to run them when you call them. To define a function we need to write this basic code formula: @@ -34,7 +34,7 @@ this is called **the scope**, and it could be local (inside the function) and global (outside of the function). **The Return**: not every function needs to return something, but it is recommended that it does. -Tip: returning `None` is a good default for when you, still, doesn't know if you need to return something. +Tip: returning `None` is a good default for when you, still, don't know if you need to return something. Example of a function: From c90e3d6e3f813cd68348039ee2aead9481ebc7a7 Mon Sep 17 00:00:00 2001 From: Rolando Scarfullery <74724935+hexbreak@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:31:04 -0500 Subject: [PATCH 003/165] Update README.md Fixed for a clearer explanation. --- exercises/07-lambda-function-two/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07-lambda-function-two/README.md b/exercises/07-lambda-function-two/README.md index db92425..70c479f 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/07-lambda-function-two/README.md @@ -15,7 +15,7 @@ print(multy(2,2)) # 📝 Instructions: 1. Create a lambda function called `rapid` it will take one string parameter -2. Return the same string but removing the last letter form it +2. Return the same string with the last letter removed. # 💡 Hint From 503453a471de0376aabbe0c798458cebc3653ee6 Mon Sep 17 00:00:00 2001 From: Rolando Scarfullery <74724935+hexbreak@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:40:13 -0500 Subject: [PATCH 004/165] Update README.md Edit for better grammar in sentences, structure, errors. Multiple & Several The two are nearly synonymous, but in technical/numerical contexts multiple is definitely preferred. --- exercises/08-Function-that-returns/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/08-Function-that-returns/README.md b/exercises/08-Function-that-returns/README.md index d96addf..200ec12 100755 --- a/exercises/08-Function-that-returns/README.md +++ b/exercises/08-Function-that-returns/README.md @@ -4,8 +4,9 @@ tutorial: "https://www.youtube.com/watch?v=-tqNmngh1PE" # `08` Functions that return +It is very good practice that all functions return something, even if it is `None`. With your function returns, you can create algorithms that use multiple functions at the same time. -Is a very good practice that all functions return something, even if it is `None` if your functions return something you can then create algorithms that use several functions at the same time. For example, in this particular case we have two functions available: +For example, in this particular case we have two functions available: ```md dollar_to_euro: that calculates the value in euros of a given value in dollars. From c770ba6476c42edd457e7e7b6db404cc78f2ae42 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz <63673743+ElviraQDP@users.noreply.github.com> Date: Sat, 13 Mar 2021 19:02:01 -0300 Subject: [PATCH 005/165] badge uploaded --- python-functions-badge.png | Bin 0 -> 13911 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 python-functions-badge.png diff --git a/python-functions-badge.png b/python-functions-badge.png new file mode 100644 index 0000000000000000000000000000000000000000..7148d8bb430182e2afa422260c10f77ae4c5efec GIT binary patch literal 13911 zcmbumXHXPR^e(()C5U8@upl5o0a3}qlA}scq99R05J7StqD0AxNLVsRMnI6Xh$KOR zzhgGgaNsbGpyzGpA2?P1i*0J<*_{yg>;;VAU!=j^XJdc&koSX z>l73e+S=Ly{yum-{^!r1&yxF&j*g6sjJCJ8eSN%^=0_6aqi^39Mj#Nat*s9pJm{TV zWMX0(?C*H|=+V;p>YLm_Nl8hLz+W-Z5$EV5BoY}B5#j0KT3uOOQC9FNHQ~vVCwX~! zG&D4wKN}q!UZ$s~fBg9IOUqW9XL*VdbqZ_G~VBfYHDiA$^Oj4!?Uw7*VEOa zsi_%QKC*Xoy0Wt3>gu|&IyEvfQka+d&ehq@&Nj7iVtl06$Y zt!#aL-Me`BE-nrT@;lsH{?NKOFfd@8+W-Cg_glAaot|MPCMIk$ z2JYUyi^HBdJ3BczIAAdc%)T9LY;3!`yYut&92^`olLHzWA&QCtUS1yfc{SM&{ngdg z85tR>szI3ZlP{l>b#%fL8^#|e{4OdgGBAjem6at--=1DsG07fzS1|PZ_wSC54iAr< z+@DijU0o%G$c=;3{r&xxrf)VjDY%uF6BDa(bz|*q^G_= zW+aXdH}-cHBWgw$W{1r`|Ivu;RgUVR^=v=KU@@ml-}+}?f1Pl0N;fl$-`)Ec7#KJ+ zvpzjNeSSRl_3KxE|H9qfUfBpIePOvqMZT0p}dsa>3*4!um9oiO*4a_VNup6D7on>WZRTV{* z<%OqP^^GIe_AuCeCM{K^XFfB#SOVR<{|a!jN@k9Z*>v#Gul^al#lkN8=1N4D;xr3FHSR&K)hZRWcC4NrU3lQB4pq>O zqz4GYTx6m$Z-fMke>FTQ9^BNhTI&IOet_FYcOB3^TZ1iUKP zgo}Ml`{({Q!Ti&B+b#>QcrVvb@Zrmc?8{UDWcu;LX2{xx_a=MBy1mggO|ofio^Zsy z!g$Ne@cLVSqQJUiVtjrZ5xR*1QoAk1g3iXGA9rN8H{A5}BIez!yJeR>gP7j`Xhn#}sg zMZM1uFer3I?1o(cNiYgx5{c2q(Sp}pwLUeK8BR(L*Q8Nw_xb6h+7@Yu@bjyN!8&4D ztgiEKFv0Ky-H_A8tmsa4{%pzbZ5+S)(6S_VpOuV;{j`4C3hRj6P|hXq|Hp7Ci1-ng z$0W?B(CE|TwA`en6@P`5{4EuCfFKKHJ?noXfda3NgA8G@V`>8x>-)?X|GJw37+se& zh{7poXCjn|SN~J@+)e-4bOK-KRpQthU!Pn{#SK02?0VpO8o!fgdNe^-TaqKH|^lV5Trt&Rkmj6 z=7ss-kT;M2#uJa)sfX99Nq3N8AtWYC8=8aZEk|pm04Ul1%`{IS-&L8Ph;Ncw4D1g6orscl{O3XUPgg%+o-&aU? zGOr2V#|o>&rSMAy(ap-%M9g9^3@&ZgFECz$ELI}2zxl5gE%b8``TE9xddRcI?|8uu z&l9TrE$n_ZG%08AjbA3jy{yE9wq*+>8A`EYR}r43odc~dF$xgeNrD@oHW7pG0~^!k zmeZ+kIo%;}(8lKazsrz#^2p8@G_`u!jUOf6n$ccYpa3 z8~%tK|Jm2ZQwk-UM6fT5vH$vny3KMS-c^o|;3_#x4B8J4d?wz|MSaeO#Xl!HxEHVa z$4vf)+B`4aDew%>%h*>#O4R-fHT(MM9dZQ^uFO$6f(||DQ2W#d{%o9n6Dkqp8wK)U zn$xJoA4S!Ec>i?3%h%i8)6?@;VC>Z>Z!*sIoT3W;(69e_C~Eee+YZ7SRCxex;Z=_*Mr-vwg>O3)cT#g4ergP_{4p8q(PEjI6c81_^!K`q$>^pDIvHQZkWbq$NNe@ft0)03yhZcc2A3^Yl z>`#2isIrtA!dL7JzD_c-eqd-TV!)P8l#E8bd^&|FaUk#vV=S_1b(SkR4?L>gl7H2) z5R)~CQG|Lrwp_6SZqJ1W+r*!gY2C4?D*lt;NHHsMTxvdGvbCt2bt!luv1stE=FbB3VXK#r>AA88$6cSOop&Z>Z3kk*#Xy zt7mYkck8$g;#WMI!=U#BqiEB)W&Q2l4Em;Sl)7B#H)~3)km#3pn^07vRx$A5t+Wjk z%-w5V@`?VB_EIh(?DQbFK&PEqag$lu<_?zovE)w0zm_&S4t)uI)XoCcx>=$kWTO^41l-sd2ExB?M$m z&*br6*?*yE1NBQre0YJK{Vr^-w7o4qwJzoa*ol7l70QZ+G&&`6;~qiBzeUBJ2{~vn zNh1eM!mcQH4MgiiNik3GcTRd4tX)0o{?a6(;A5rlCPLztU5EKFKC)=c)YRt2D-Q1X zM2R^OC&!gt@>^(><5SG$G@O;-GHN^%;E}_mF%s1`0(ldiBI$iqzM=(m}6Ix zB=FnVehwNZ>clB%;!B5C!i7aXrQc}+ZO*0@U9zO>S?b#tem_XCx;48)diP1b&$E1E zGrFhtVD$E%f#u5`fIQpDk6oDNEuq1Q2t`=m1?N?gc9)XH5txrm( z{l%hZ&3)#+tgbxwEA+CI^t%!t#-P8vioKwixWgR{E*4GYRgs@2=ekH=PqA6>d5 zNY5Wxty}!7xmz4{OVw8E74~DhG*^@cfPcGNiryaq-oK)$RzxRXZf9R{V2V$ZZQ|L?g&V>bjs368; zu8~-vPI==Mp#aRMN02#0szkl_0lKm-ISH)5t_MTL6_m{xe(?vv%E9f}H-9{8>h=$8 zvFA+N5_+`tO`_ppex=oPoodU(p^8vTBW)ij2*G(p``U2kIAobS<2I@ItHD_&o~G&pNJ{Cc5xWP83Z>TS?>)W(1QseeD$ zo-BD>Mo%y}{IzJ%mGvmH`*X?MEhQdT9c++L+f}W~;Bh!n`&q)lR64O9U*o^b+A1MI=89`+ zlaHG^(^|YD0tKS zXUfL_BgPh+4%cb?mUa0uNRu!sLE(C#Je$MCm$!JsEZzhB5>WRxJ8Q*IP1j6aaU1@b z;#bfn!nw*nk0+{hf8Ak`e*fa&t5*^0LnW9ifmcc3N^l}F{o?DVx#s4b{-o)Jas=rq z1%7$MN8HgE%^-0(<6EzLF<}Da2)SJw3 zdR9rR#32L2Pf#EqTYEO~>fSG03b*nQZ***moZA?JC#9SaZ6aF#Go|3Z`cgV?HaQ0r zAYav$Oatpi(DU6!Rd9I=v<(FnFOrZ)d6k}xw(#iHP4%AQMi2TadLIYh;@rgKLUo@A z;?Kr|>h6LvU6uoE+=hIdusEP#h@{AmGO~wr_gDVf5II3^>F1YUwViW&LP~#c=y$gL zv)CgWQ81!WCdTTzPs2%gc0jv75A{(027IVO`17<#I5ww1wnG|ZU}`3=3Y!+16&O6Y zlnh9a8ih0OwGAkQTjyR?d;Bb~r>nbG+l z^$x3Llk1M*jCs=wu5BRzV2BXhrC zH^mu_r6~BZn?T0nQpShCM||-8=KshvxGR)<{JvnVDL8#+uaRRyO^q?usJWkHJ^0Nd zUWZ7Jd->hNvB~JG7Ic?Wd#iAPn^AHv?dt>T`Wm+6z6_hvG%B{rIpa`xk16=$)Y-@4 zTJyLgiAjZ5kGTWGF3mer*a>tOOE(aA<1!I?xJN&NzIGS_=lBK`3RX|LbT4cN8QY2a zu}UMI6_RK_F4mnC_Bna-Uy7Jl6}#X*9nY0hBr90uZxhu#qQdy>-Iyiuw$PKk6QuAb zt*zBqvaVNDjqkxx>XWA8wWU({9cbf5g~B|@mIIysYS|a^BG$}ltH3uqNs;mmL-txE znvhnVA5DHx3BD?$&TkVs`6qe_l|i}qvByo_%vh+!mudts*rq84sLCQi6fB5j3p(6B z2+#$-5uZYZt`QG0876`L&MGGIrx5?UrJd|Ab$8BWXoiNaYUV&<@dr~?{x_w!52PMK zDvHDeAf55)7IM1Dc8n$47hM}niiO;G`a$&9G-jkP+KKCe6$^C`y##K2$3`Q7iefG$ z$dX7V&hOt;XKTZM20Hz`ZUmey%uN``>E5|e z0fA&clN<7`R;^oH$J+al6N;DM&E7V6DXVDxh4?K?3=FIL6LEyQdIU70iV5Va$X{%m z2r|e77sjv*-3sB1x$RqnXUPl$pB^S;$y^0p`fF51+RuhQzXzWlRkgk&#cd3KFTEl=kwC&wcuVUNae8w)<>jGs!{bDUK3;i6eFOCu|M zlV4qa@gL+?<*7s}GhpYS!Hs?K<@VJJphwW}chAQD?~@XBaMN2$!cVJIGRN@k%T?5? z_ne(neY^Oav*H>I`-QDi={}!QS-Zo%qXWH?B#IXSp(a_c2^-m$T!IiIZYM}p8i8l+ znZ_V)jdQmTYVZ2ggLO;*FMw38VQ^JK4S?G(z{+28(HL3@_KWiNm);}TNy!zLm4vrG zy^|g0EP7eB`~@Hv_)0!LdzQq(Pr3Bm4={^@7FJOUd3rBBCwVf`&l95|b~Izt_X5XT z7+T^ZsYA=!cLS4)r9I$$d71jMXzh_p4O>wqkDS&1fkDaBOM!#LQfj2i(+UY+2~%^r ze$H2`fOhHCx{q3(zX-ETk~(zIGsrsSnY)$N7E|H}C~Eq3^Ud)uIAoA*!d5I0gF?hS zN`EDx?R4F44Pme2KjT;6$92>r;FU!W*+BygZ6K|c+G~--Bp`!eUsaKO7Zmr@8ov_* zgrZOtcf(?enN3bxPil`*w?2X_XXFKxd0+rd&23N|8tt&yTOT}!xl{^%bqg-Xvp31S z5BllGe6m;_L3v~hzV?*DO#V>8mJTJQLt+M5m|+jC(i=A5=O~DPPirg#KYMtJC1ycn zY>!|qlqc~x|AQ{eRTn>tg9cCSrw`j9{j7!$m?83lZQrTs7|WU!&?FX;$7fiZxtJDm zO1#p0Sq)7VjWOj6@KQ=F{7d+RIoLa>Y%fg{oC%<@+kuiT9Eo>J6mvOtPvKr&fF*>8 zl5`%+vusVQ2Y{T5I2M0l!*>mc_$~kec*mLqNPi06C0uM4X~VJ`mNWt@kIt()0XSg) z;nyLG$LNH5Ih3x3au~B(fyux%f1tV63FluqGXeoZcd*IZoU#fU{9Zqoc`C(4o;3c%J9dQ47W>L7*}lsTi=p1eVrNvBW&4ze&C<8W5XX2yP* zY@#C2M-*&0;~1xTlp$S8eoAnArgk_H@0jg6d*$eTzl{IY%(?}?sCv(5B8O(nvv<%# z&KbsO5$KW;b_?%8g%ub*(9H1vctdxv;4am15(ZJiGV~VrK@WlC;^ZV?f* zosqeIf#KLG6$bt9p=sm zBwZD~cXvh2?nl#(DC9zX^rR8V)^)@I=|Z(&$vF2r5RYCHSELrN`t72sBU+ zz5ntiAZT|8+=a9uI39~|f=Hq}sF83SYQj>1`6GtH23ph^t?Oa{3N&ucm=A9iycP&} z;eKMgLvK#?%y&OlBgO6c=ZG50wi)(}sHnUTo{ENfuZ>o#B>2Y_YxGM?V~f^yBTmbP z`~Pvc8lL&l7pPk^8>KI`rA%l&3?Tr&px`H>(E&W#c}&%}jz2X{(TzvUJ~dwCOE;!z zDb5b6gTwx)FH(LLnUTt$QQaZkPpJN3(Ac_+4i379} z_?)+YzkszH2%v#z$kbW;*2UA9(p0QLHm;fHjFA(I|Cg=*WEZ*tOgnx-rNA^f{HCg* z_kObvPZP{xlsF&;u?KteIuFpI)rMa@B{Gj9K&6nG_nLTOxZCpj%YFSU^Ku_n$4rXT;$_w z&+|o5OSjMf5>-dpf#$VxFSx@qqD6Z+hvH76N)r3X4v=|jl-AOXre#_LOQL~d2t8R@yf>TvD6d=xM$|%YUyb@60giQ|nPmZ=&WlJL;?@Z5G`^8d#omPRjsn5vMcMB}K7v_guZs$~ zB(_)&E!pNhN@Ml9z)=EO;hR(-XV}7xc$fSfa`)4dSwj_qjF){$;YsX65rbp1SW>>h zM4-B8K{8edBrBbQ*umanjLLyAHLOzw)cabs87u_ezHH%*XTdT;Daw}a51uipfK&Rq z_79IX2uSaX)w=8@TH}j8vF;aNRKUQ`a*vK!Mrn2-5x}lPgE8F}pR`4bN-$;p8;m%P zl2sEg!pJG8{zsF}veV5+D0IVP=XgvTpDVA=kbti8O}{7Zb}bHa+dvz8j7hO=_sY8C zcNv4do~2Ud-1d|k^Ie$>7L?ve;_hSc81?!-RbFFt+tdGn1*OKFmDbEeL~0YUr~kXR z9ePa_o;xr$94cp2IGzAQnJyK-+or$}>I^xm6b>mu*0+ah5IvxK0%3y_HzbEfdha3* zrhtVSsKplY?Ez2X|1StAB@lO2|7Hw{G#F+XIU;gD)5K{w=jCh$*F?KnZjP0C$Ia_B z-a^H{Iou^Qc8_L^XNzzUf(fXut33*Y$S!R1#H)1Cn zWG~y)?5}~0j$8)w>vDw7i|g{az_Abkon{i9IBa zOB3on!2b_7?Mxx|us#clQzuyiKbAP<4xm$nQ0Yp9Fo! zTXDH1OG3R{xy3}Hb|a?Y?}WC!jFGNtqU<2Jy-Cu1ZR{>+B} z;9;4Ev%tyZYjUek1c81;q>R>q9ZfUvJWUbSj!m&yB(V!LcCQ+WA}sS6{3iD37kw?s;C=-P-PQ4} zF)SD?XeIFSTR}-UvHaHgzbTUs7<d)4jO59t(8?yJ8nZWLXkZNPL8_ zV03r+2qH_l=Ep}T_xLKW61+V$W%=R*fgdEJ`4`dNj}*@PCQFSm4sCTn{QV{jIr~1p zy?dEymnF63?60j>apgZ~UCV?JD^s)Yv!Kgmbj5{F-=LA~7nWUW`0|tNy36}5#>+Xg zNyyc@rTmq=1TW;yB~N*S`-mkT;f#idAs$#z9GDZ0fvGjYgT0UUkrTs?5rm#)TEBhj zYs>?oBbMdN>XYm7A#;{3es8KFLBdxf#t5SwMIpQvUr8>nND@&x>f{<7E@1-M)K*6$ z6+1K%Wq1)=Pfy1f!>0|S1f(@iXiU+N6j-cmWSTf$y3sV$z)s$~9bRs>lszqaur+im z`;C-!4lhp`@qp6%&WMUc!-Ip$$nx;4N-d{!*zgtKdhtCl|4wZ{lZko!%Oxn9P<)wM z_oo1x8DQry$dp3tVdLrAc(fcX;JMM+synpM+JdsA!|Cc7+v63WCr}(>>4Xq4wRJ*< zzdvtT6%a^R*_uDg7-E^^+QUre*LQ8WysZTMk1qCXEv-%pL)ehj$B(#OV+jH!WfTDl zKu$9)ra9r%72N4@kz#2+jOP-m1bhK-!^sap_=uaeg0!}`MQ{9Qt>KuO=Iq~CLot{jz^R z#FU)BVONM?{GzCI%I-tOFH~*HpN(C2S`=@{nO0w)Frw0_sjD9J(*MrD+)^kR`hoeT zU=UAJ=!)O;tLaC1Y_===-TQYoBJcfJc>o?{-gjUB!=~5>LbAJsJiS%TLd7km8$0=J z3=pmB8|{o`v_T<{U=A3(RC<6W<6{LSj8~q{6J#nflVW~J543W9s|{YlM7|d-CS+3y zbX2kzjs4H_)WZQgnc;afaC7=Vt+Hje)NpA#=|{M|8H2h z+$xrq*?hCeg8!MCN;>Q56X$7sj;Q04?GTc?^7VmK+;aELp^%jYu&lDcWB$z8w`aUL zDW(`xAJh!mIzZNWk$DKvc0mf;_0HG)k^IEs0n`2;SCE2gpB6W4GNJqg$^~ueiiq_7gznNI6-fYUNRs%^xgc_s$&o zD(diX5}3#{7A;C%s)7_6X1FR6Oyi)?@TV+JTiq87*E@lk+4;)9u9k=eN!e}y)}c0K zpY$kb3ljM5wp_h~FZfdGcmoS)M(N8P{PqFzjx67u(N-_MaK(qI2=Ixd;FGa{F%T_( zI|qs+x33GjXE3xmbmi(6lI^=VL~$eYUi#`uDwuo_M!8K(opoJmR!pY*cgqa$yZQqf z&MGV6uP!VzpQ$F;Jc^RdC*1&YmS!&IwfKtz82!UhrF|li&P0Q!ezCaI}>3+ibKRT<1>WE$3+a z{>4pXYO375W|lEH<6K+paaev)$Q99~@Z%XNcB;4@AqgYk2{x297+VdXB zJestX7ZuMW9oTryo3C0eB@K~8>_8tHF9W0SITxA6NICf?uXNp%EmBcyjDb6>L)_nkRSv`31#YkcuN~ zK^OKRTj)DF$S!p)0KNnw?ldy<=-cDpuvXB}z}y|2FA`gRH|d$#ioc@O%0IVq~ZUn{Mw6G%JcU&JUT z`V1btoCUdXIdxY+lY+kLkYl7ZfyD}Q27LBk)cJcAkMP%q9<7q?K#IR=q1UB@#+JC3 z3E)gXU>`V}a%TbxQP+bk?+?WmT8Z0-SFd4bN#f7oKXW51549;+i1^14?t-3eRs^_@ ztMHH3F|ktUr>MN$l#i2tmQXxkLV5?cwGrCi4VI>rdHP#>mQr-=nFxrx z9?F$c?Q<_kRcuaOaF$F5pPhiYK@*69D;H-ur*V@2JOk3ncM;#X#aRy^Qc8P+&J670 zv@{{VutNpeLSGJ1UgI)fzI6cQInH6L9yre*xp_k@3lMq2;%-(=McCcz??0mN4#I-S z=;f-3+15S;r+y*(%B1Vm>0_Rn2mS%?bG zeq+CU?S@Se|<`hJczX6!PnYMh z<&dE3nfBB^=<64_Rh3N)RGrjH=Gt~!gXsoQslnEPlgPxSMNIsm5vvIIe`PL)R@8SV z;E`iY#5xWH7ID)$yZy8Wi5ILc3TH*cy))<^!Wl}ccQ@iHVvZ3Ge~&DQg~BXGM|R#N55>g)~i3*Y!ww-Y4@&M@4Fe7hDT@MJ0NbbS{v_fJ0W= zgUW6Tx2dyvaz6O|lk^p3;-M4MAdKt6afI9;S}J4DMRIoW&3DxF8=!U?d{s*rc!kRt z_>ZXC>-xr*Wy0NMedqVHJLs5|^vqM6wuf3$%sx8Zh!+obw4S`|&#yX@RBK*nDe2Ox z+`28LGL|fk?4kIDo)nfE8@aN^`jhu9tTRo zEzQ6Q1II-5EFK4Xzrq0>-j1S)ALTnl0tJ5Rw1xT&1907cvPt<4v_`>o{c6*o4jtKz ze+-TX%k%S4Y2+=cO~RK`+S>yJ6eQ+26b3do;%5KcocJr-{S!nayQ5)w;?E&P;siTwR&s*7-Ut%fd}|bZgT)Rf z*5mbxtntwijpX_%%K92pr_cQcfRQep%KT~Lm5s9k&%=Y1O|I)SSYua(SpY|=`S991 z{qNAXH_rHWww=TE%QKfSQZ8L=TFgy_Q6%M-NG1Q09!HD%EgdPMG{bQC(HdE|9Z|lG zTev{>saOn&BMyTHK?LdJ{i+{3&l)mkk!g*uh8H&m&<7RDaYYcV3bkfXgin(Qp{rD< z>9FGI?DNdqh3$`AIA|GE7nES7ts-`?sKWk|0%kmR~w*3#+6m+_>&7Gj^ovb z0o9ou!G=&)72y$w_Pu5e8c)&)yb<5P?`nL@iL4Fkq3aOuk zP-Ly>`j3qsi@fpB9QA|x&qeE%z6;(%?pmc#LkR>qb7760vHXTuwuGSj2MG`<@D3Wc z^-|N$MRS?R>?EEhUF}(G?k_N0aa>VPs=0afc_C}ui5g`An_O<91_}4HlYv!qO)+1I z1+}EHmi5TJi%)F*^gZ7Fs=cyKX|HYmn7n@_Q^-ocp)=~;sUbrtRC7%WEiNbEobYb4 zQf1`xJ7a9EYQp7_8%Oux8U?e}Ox~jqBOcZk@rdTSNvg#fzxiM*yl^P~J*D&Gf$BB;oe0bIr4a^ft#~ z1dGN!UJBm#=d}GptOhj6vgE-Jg=j-|(gxx~R^S%$$80eza{Jr;&ernPE1udORqFaclkSC0N8I%~^t%UiGBdou? z`m6Y_nE=OV*vN$JX8wT;-+$g;yqm~mZ`b#f;H{ZRI7rID`BSUQVnoDZb&uLbwG!y$ z)WqvTd}8rJzxcLDyA>u>2q~&#wCdLd^)=bgJBQ?y4bA~_lYlY*2W3~JTV!2JUa{wk zanU_n5bxuwH;`^0zIJ9wAGw#i4Nn=GyLvwP=_1MJ%IQV{K!g0&1UX$$xv`D5I75S1 ze7OGPH@^LwO3UiJGfepz2t7c5a&vANU|h95;CD4XFD5c71yQ8w zp3x*LgL9%6$&I%v>Hqk#QEP5>_*}VE!}8I;3B@6F(oEoNKTa+g`h8}3pQ)de;FP;+ zbhg;gSh|g@Zj9fz%;-BIi>h+b&!OEFfeCv(MQWIlOaCVEzfTYg<{yW$B;MuX7Wb^f zSgaDlK-%C~f7Vec1B|NmODl_k6Eb?qqtH~_Oa_&}BItgO^!Oqfb0}!dU;Z#MDI*2c zm@3Et=p5*On46xlJRG;|-2urv@?Xrit9J3dBoR+Q>(gF~l=xy4_BT&*&>o9~CD;Kx zMYu_pi*UF2`uZG%$S*x(PV4b$osJ@58FDkn_kI-NgZAr-OXF9!rE67ePKQB-$Y9!8450zKVa*_Ny^6Pp2 zYYIGR;I;gR^T2c68}0tyE04}0JKCdfw%qQl+Xsr7Q}^Has^z~NYl7e5dfdWa*qfHc zaro?Ma=0ex94BS4Tf+9 zKX6@Z>Q^)#YRk+2PPW_lmU$|3AGosSVge;NkgSR-jHGLp6c$Dm@&PSimb#NkafhIhE=DZ{BNBJfe z;njs^X!H<>56*mH%@u7DxY8m$v)>7GRVK8GyDCYYx-f`y*J!V1;KWk3rkHLI-g3>0 zeS3Y{<&@w4T7T{b*8NUaL6DXZVMQp8Bsb{a*J$r80mZvppAu-+sZh{4tb|c@fYSBf zCu+W~^X6m2UWbz!@Rn@=}5G{@5Alqp3g51nHIxO5vnbPmM>O( z>PXCue%r%|?mQ2veDUix=Y1Z52yfPzhJB>n+&*d;xljGGCb9rab#>fwI~RBV( z_#%Y#lVeg{#j9uu?!Z}a1U-iatctX5&()L{$3HfhN$qX0(>7eeuDqA}p(20tyyM%* z_Otr~X>0C}o_5tV+;Ngqp$DEDJC`!;+T?0~5h_77ZZ2w`aLNTV^eJPg4nC@wK}TzB z`kHM{o*CHY-uDg5bd%x(3h&aVAq6`f>WEhv2I>h*Yc=lU5VUS`jnIiAT)3>M>qDAj z2>P=GRRZt-SVVo(ppbyIbHh5(ov4-H!E0tzT?p_f0l=@qAxsZ2w}KG30}k1aV{}gz z*HHsN1|$hNgR}UC3zz=^K+iVVG6Y+*!a}b+(yY4WV?|CO*-%xe-v63? bXDMa Date: Fri, 23 Jul 2021 19:53:44 -0400 Subject: [PATCH 006/165] Update learn.json --- learn.json | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/learn.json b/learn.json index e2e7c62..c793037 100644 --- a/learn.json +++ b/learn.json @@ -1,25 +1,4 @@ { - "port": 3000, - "address": "https://a59821c5-aefc-458f-84bb-510905bccbff.ws-us03.gitpod.io", - "editor": "gitpod", - "configPath": { - "config": "bc.json", - "base": ".learn", - "exercises": "./exercises", - "output": ".learn/dist" - }, - "outputPath": "./.learn/dist", - "publicPath": "/preview", - "grading": "isolated", - "disable_grading": false, - "language": "python3", - "compiler": "python3", - "tester": "pytest", - "actions": [ - "run", - "test", - "reset" - ], "title": "Learn Python Functions Interactively", "repository": "https://github.com/4GeeksAcademy/python-functions-programming-exercises", "preview": "https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/preview.gif?raw=true", @@ -27,5 +6,10 @@ "duration": 10, "difficulty": "easy", "video-solutions": false, - "graded": true -} \ No newline at end of file + "graded": true, + "config": { + "editor": { + "version": "1.0.68" + } + } +} From f060763c57feb2fceeb16e6ea95899ac14b89a38 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Fri, 23 Jul 2021 19:54:13 -0400 Subject: [PATCH 007/165] Update .gitpod.yml --- .gitpod.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 2ea8d8d..b307e19 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,9 +3,12 @@ image: ports: - port: 3000 - onOpen: open-preview -tasks: - - command: learnpack start + onOpen: ignore + +vscode: + extensions: + - learnpack.learnpack-vscode + github: prebuilds: # enable for the master/default branch (defaults to true) From c9b580704ed7edd63aa17fbb3289e5c4298c00e2 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Fri, 23 Jul 2021 19:55:34 -0400 Subject: [PATCH 008/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 6408d52..f40aba5 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack && learnpack plugins:install learnpack-python +RUN npm i -g learnpack@0.1.8 && learnpack plugins:install learnpack-python From aefa296560e3d5eda04f2f370db17508a9036d16 Mon Sep 17 00:00:00 2001 From: Pedro Yanez <72775296+wotanCode@users.noreply.github.com> Date: Sat, 24 Jul 2021 17:31:28 -0400 Subject: [PATCH 009/165] errores de tipeo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hay un error ortográfico donde pone "in" cuando en realidad debe ser "en". Además de eso, hay un error importante en las instrucciones donde dice que la consola espera que recibamos un Hello World! cuando en realidad, el test unitario espera de nosotros un Hello World sin el símbolo de admiración ( ! ) linea 13 del test.py = assert "Hello World\n" == captured.out --- exercises/02-Hello-World/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index da0a93d..c4a47bd 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -1,6 +1,6 @@ # `02` Hola, Mundo -En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) in algo llamado `la consola`. +En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) en algo llamado `la consola`. Cada idioma tiene funciones para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza sobre todo como herramienta de monitorización, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. From 7d694895415fa4a50c1e8078bdd4669da3dc61f2 Mon Sep 17 00:00:00 2001 From: Pedro Yanez <72775296+wotanCode@users.noreply.github.com> Date: Sat, 24 Jul 2021 17:37:34 -0400 Subject: [PATCH 010/165] error de tipeo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Además de eso, hay un error importante en las instrucciones donde dice que la consola espera que recibamos un Hello World! cuando en realidad, el test unitario espera de nosotros un Hello World sin el símbolo de admiración ( ! ) linea 13 del test.py = assert "Hello World\n" == captured.out --- exercises/02-Hello-World/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index da0a93d..320b559 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -11,7 +11,7 @@ print("How are you?") ## 📝 Instrucciones: -Usa la función `print()` para escribir "Hello World!" en la consola. Siéntete libre de intentar otras cosas también. +Usa la función `print()` para escribir "Hello World" en la consola. Siéntete libre de intentar otras cosas también. ## 💡 Ayuda: From be715d3c6578eaf4cfb10316fed47633be74d508 Mon Sep 17 00:00:00 2001 From: Pedro Yanez <72775296+wotanCode@users.noreply.github.com> Date: Sat, 24 Jul 2021 18:28:44 -0400 Subject: [PATCH 011/165] =?UTF-8?q?Error=20en=20el=20c=C3=B3digo=20de=20ej?= =?UTF-8?q?emplo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En la linea 32 dice: return (num % 2)! == 0: En python esta sintaxis es incorrecta. Lo correcto es: return (num % 2) != 0 --- exercises/06-lambda-functions/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/06-lambda-functions/README.es.md index b9ee110..246bca6 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/06-lambda-functions/README.es.md @@ -29,5 +29,5 @@ Así es como declararías una función normal ```python # this function return True if a number is odd. def is_odd(num): - return (num % 2)! == 0: + return (num % 2) != 0 ``` From fcfd3c449bf880362ade1951a19f82efe8c0bced Mon Sep 17 00:00:00 2001 From: Pedro Yanez <72775296+wotanCode@users.noreply.github.com> Date: Sat, 24 Jul 2021 21:06:44 -0400 Subject: [PATCH 012/165] =?UTF-8?q?Se=20eliminan=20l=C3=ADneas=20innecesar?= =?UTF-8?q?ias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exercises/03-What-is-a-function/app.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/exercises/03-What-is-a-function/app.py b/exercises/03-What-is-a-function/app.py index 551610b..daa9ff3 100755 --- a/exercises/03-What-is-a-function/app.py +++ b/exercises/03-What-is-a-function/app.py @@ -3,10 +3,3 @@ def sum(number1,number2): total = sum(2,3) print(total) - - - - - - - From 3a33a037f11f59c9842e14d8d8a253dc6ee23af5 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Thu, 29 Jul 2021 21:15:12 -0400 Subject: [PATCH 013/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index f40aba5..aa459e6 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack@0.1.8 && learnpack plugins:install learnpack-python +RUN npm i -g learnpack@0.1.12 && learnpack plugins:install learnpack-python@0.0.34 From 35689ae0e7025dfc5f833a10370acfbb5a9ea3c2 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 5 Aug 2021 01:44:19 -0400 Subject: [PATCH 014/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index aa459e6..629e22c 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack@0.1.12 && learnpack plugins:install learnpack-python@0.0.34 +RUN npm i -g learnpack@0.1.14 && learnpack plugins:install learnpack-python@0.0.35 From bfcb529b0d592137578015c9668d5adb8bdd0ec1 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 5 Aug 2021 01:44:30 -0400 Subject: [PATCH 015/165] Update learn.json --- learn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learn.json b/learn.json index c793037..662a28c 100644 --- a/learn.json +++ b/learn.json @@ -9,7 +9,7 @@ "graded": true, "config": { "editor": { - "version": "1.0.68" + "version": "1.0.70" } } } From 441158757b9fab9e88078496f21d3bce45cc101c Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Wed, 11 Aug 2021 19:24:19 +0000 Subject: [PATCH 016/165] finish reviewing instructions --- exercises/01-hello-world/README.es.md | 15 +++++--- exercises/01-hello-world/README.md | 15 +++++--- exercises/02-Hello-World/README.es.md | 15 ++++---- exercises/02-Hello-World/README.md | 10 +++--- exercises/03-What-is-a-function/README.es.md | 8 ++--- exercises/03-What-is-a-function/README.md | 8 ++--- exercises/04-Call-a-function/README.es.md | 20 ++++++----- exercises/04-Call-a-function/README.md | 11 +++--- .../README.es.md | 36 ++++++++++++------- .../README.md | 10 +++--- exercises/06-lambda-functions/README.es.md | 34 ++++++++++-------- exercises/06-lambda-functions/README.md | 24 ++++++++----- exercises/07-lambda-function-two/README.es.md | 15 ++++---- exercises/07-lambda-function-two/README.md | 12 ++++--- .../08-Function-that-returns/README.es.md | 27 ++++++++------ exercises/08-Function-that-returns/README.md | 26 ++++++++------ exercises/09-Function-parameters/README.es.md | 14 +++++--- exercises/09-Function-parameters/README.md | 17 +++++---- exercises/10-Array-Methods/README.es.md | 12 +++---- exercises/10-Array-Methods/README.md | 12 ++++--- 20 files changed, 205 insertions(+), 136 deletions(-) diff --git a/exercises/01-hello-world/README.es.md b/exercises/01-hello-world/README.es.md index e164d50..59194e2 100644 --- a/exercises/01-hello-world/README.es.md +++ b/exercises/01-hello-world/README.es.md @@ -1,15 +1,20 @@ # Aprende Funciones en Python! ¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 + Presiona `Next` `Next →` de arriba a la derecha cuando quieras empezar. En este curso aprenderás los siguientes conceptos: -1. Cómo crear y llamar Funciones. -2. Construir tus primeras funciones reales -3. Sentirte cómod@ usando Funciones Lambda en Python -4. Construir Funciones con parametros. -5. Ejemplos de la vida real con funciones +1. Cómo crear y llamar **funciones.** + +2. Construir tus primeras **funciones.** + +3. Sentirte cómod@ usando **funciones Lambda** en Python + +4. Construir **funciones** con parámetros. + +5. Ejemplos de la vida real con **funciones** ## Contributors diff --git a/exercises/01-hello-world/README.md b/exercises/01-hello-world/README.md index 37c7913..c9a83c8 100644 --- a/exercises/01-hello-world/README.md +++ b/exercises/01-hello-world/README.md @@ -5,15 +5,20 @@ intro: "https://www.youtube.com/watch?v=awa_yfGgy9s" # Learn Python Functions! We are very excited to have you here !! 🎉 😂 + Click `next` on the top right of this instructions when you are ready to start. During this course you will be learning the following concepts: -1. Learning how to create and call Functions. -2. Building your first real functions -3. Get comfortable using Python Lambda Functions -4. Construct Functions with parameters. -5. Real life examples for functions +1. Learning how to create and call **functions.*** + +2. Building your first real **functions** + +3. Get comfortable using Python **Lambda Functions** + +4. Construct **functions** with parameters. + +5. Real life examples for **functions** ## Contributors diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index 51aac1a..9710f1a 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -1,19 +1,20 @@ -# `02` Hola, Mundo +# `02` Hello World En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) en algo llamado `la consola`. -Cada idioma tiene funciones para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza sobre todo como herramienta de monitorización, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. +Cada idioma tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza(`print`) sobre todo como herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. -Este es un ejemplo de cómo usarlo: -```js +Este es un ejemplo de cómo usarlo + +```py print("How are you?") ``` ## 📝 Instrucciones: -Usa la función `print()` para escribir "Hello World" en la consola. Siéntete libre de intentar otras cosas también. +1. Usa la función `print()` para escribir `"Hello World"` en la consola. Siéntete libre de intentar otras cosas también. -## 💡 Ayuda: +## 💡 Pista: -Video de 5 minutos sobre la consola: ++ :video_camera: Puedes ver este breve video (5 minutos) sobre la consola: https://www.youtube.com/watch?v=vROGBvX_MHQ diff --git a/exercises/02-Hello-World/README.md b/exercises/02-Hello-World/README.md index 8cf9228..99bb08f 100644 --- a/exercises/02-Hello-World/README.md +++ b/exercises/02-Hello-World/README.md @@ -6,18 +6,20 @@ tutorial: "https://www.youtube.com/watch?v=voBO7a0KPtE" In Python, we use `print` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called `the console`. -Every language has functions to integrate with the console, as it was the only way to interact with the users at the beginning (before the Windows or Linux or MacOS arrived). Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. +Every language has **functions** to integrate with the console, as it was the only way to interact with the users at the beginning (before the Windows or Linux or MacOS arrived). + +Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. This is an example of how to use it: -```js +```py print("How are you?") ``` ## 📝 Instructions: -Use print to display "Hello World" on the console. Feel free to try other things as well. +1. Use `print` to display `"Hello World"` on the console. Feel free to try other things as well. ## 💡 Hint: -5 minutes video about the console: ++ :video_camera: You can watch this 5 minutes video about the console: https://www.youtube.com/watch?v=vROGBvX_MHQ diff --git a/exercises/03-What-is-a-function/README.es.md b/exercises/03-What-is-a-function/README.es.md index 4f0aa47..93e8ee9 100644 --- a/exercises/03-What-is-a-function/README.es.md +++ b/exercises/03-What-is-a-function/README.es.md @@ -2,7 +2,7 @@ Puedes ver una función como un **fragmento de código** que puedes encapsular entre llaves para poder usarla varias veces. -Por ejemplo, si queremos obtener la suma de dos números, podemos declarar una función llamada `sum` que devuelve la suma de number1 y number2: +Por ejemplo, si queremos obtener la suma de dos números, podemos declarar una función llamada `sum` que devuelve la suma de `number1` y `number2`: ```python def sum(number1,number2): @@ -15,10 +15,10 @@ Después de declarar la función, podemos usarla tantas veces como queramos, as total = sum(2,3) total2 = sum(5,10) -print(total) # prints 5 on the terminal -print(total2) # prints 15 on the terminal +print(total) # imprime 5 en la consola +print(total2) # imprime 15 en la consola ``` # 📝 Instrucciones -Calcula la suma entre **3445324** y **53454423** y asigna el resultado a una variable llamada `super_duper` +1. Calcula la suma entre **3445324** y **53454423** y asigna el resultado a una variable llamada `super_duper` diff --git a/exercises/03-What-is-a-function/README.md b/exercises/03-What-is-a-function/README.md index c49d55c..7f2a283 100755 --- a/exercises/03-What-is-a-function/README.md +++ b/exercises/03-What-is-a-function/README.md @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=tgTLyZ0cKj4" You can see a function as a **fragment of code** we can use several times. -For example: If we want to get the sum of two numbers, we can declare a function called `sum` that returns the sum of number1 and number2: +For example: If we want to get the sum of two numbers, we can declare a function called `sum` that returns the sum of `number1` and `number2`: ```python def sum(number1,number2): @@ -19,10 +19,10 @@ After the function is declared we can use it as many times as we want, like this total = sum(2,3) total2 = sum(5,10) -print(total) # prints 5 on the terminal -print(total2) # prints 15 on the terminal +print(total) # prints 5 on the console +print(total2) # prints 15 on the console ``` # 📝 Instructions -Please calculate the sum between **3445324** and **53454423** and assign the result to a variable called `super_duper` +1. Please calculate the sum between **3445324** and **53454423** and assign the result to a variable called `super_duper` diff --git a/exercises/04-Call-a-function/README.es.md b/exercises/04-Call-a-function/README.es.md index 9dcd538..f0247c0 100644 --- a/exercises/04-Call-a-function/README.es.md +++ b/exercises/04-Call-a-function/README.es.md @@ -2,7 +2,7 @@ Una función podría recibir 0 parámetros y tú puedes devolver algo siempre, incluso si no añades explícitamente el `return`. -:point_up: [Presiona aquí para saber más sobre funciones](https://content.breatheco.de/lesson/working-with-functions-python) +:point_up: [Presiona aquí para saber más sobre funciones](https://content.breatheco.de/es/lesson/working-with-functions-python/) Por ejemplo, una función que calcula el área de un cuadrado sería algo como esto: @@ -18,25 +18,29 @@ length = 3 edge = 6 ``` -Necesitas hacer algo como esto: +Tendrías que hacer algo como esto: + ```python area = calculate_area(3,6) -# The value of area will be set to 18 +# El valor del área es 18 ``` -# 📝 Instrucciones: +## 📝 Instrucciones: + + +1. Create a new variable named `square_area1`, `square_area2`, `square_area3` and call the function `calculate_area` three times one for each square in the picture, for example: -Crea una nueva variable llamada squareArea para cada nueva iteración de la función CalculateArea utilizando las dimensiones de la figura, por ejemplo, para la primera figura, +1. Crea nuevas variables llamadas `squareArea1`, `square_area2`, `square_area3` y llama a la función `CalculateArea` 3 veces, un por cada cuadrador en la foto, utilizando las dimensiones de la figura, por ejemplo: ```python -# For the first figure: +# para la primera figura: square_area1 = calculate_area(4,4) ``` ![img](http://i.imgur.com/VyoJRAL.png) -# 💡 Sugerencia: +## 💡 Pista: - Llama 3 veces a la función `calculate_area`, una por cada cuadrado, pasando la longitud y el borde de cada cuadrado. -:tv: [Video de 9 min sobre funciones en Python](https://www.youtube.com/watch?v=NE97ylAnrz4) ++ :video_camera: [Video de 9 min sobre funciones en Python](https://www.youtube.com/watch?v=NE97ylAnrz4) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index a1a6563..f26383c 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -23,14 +23,15 @@ edge = 6 ``` You need to do something like this: + ```python area = calculate_area(3,6) # The value of area will be set to 18 ``` -# 📝 Instructions: +## 📝 Instructions: -Create a new variables named square_area1, square_area2, square_area3 and call the function calculate_area three times one for each square in the picture, for example: +1. Create a new variables named `square_area1`, `square_area2`, `square_area3` and call the function `calculate_area` three times one for each square in the picture, for example: ```python # For the first figure: @@ -39,9 +40,9 @@ square_area1 = calculate_area(4,4) ![img](http://i.imgur.com/VyoJRAL.png) -# 💡 Hint: +## 💡 Hint: -Call the `calculate_area` function three times, one per each square, passing the length and edge of each square. ++ Call the `calculate_area` function three times, one per each square, passing the length and edge of each square. -:tv: [9 min video about functions in python](https://www.youtube.com/watch?v=NE97ylAnrz4) ++ :video_camera: [9 min video about functions in python](https://www.youtube.com/watch?v=NE97ylAnrz4) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.es.md b/exercises/05-Defining-vs-Calling-a-function/README.es.md index b615ca4..b4d2d60 100644 --- a/exercises/05-Defining-vs-Calling-a-function/README.es.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.es.md @@ -1,26 +1,34 @@ # `05` Definir vs llamar a una función -Las funciones solo existirán si usted u otra persona las define ... es la única forma en que el compilador/intérprete de idiomas sabe que existen, por lo tanto, puede ejecutarlas cuando las llama. +Las funciones solo existen si tú u otra persona las define... es la única forma en que el compilador/intérprete de idiomas sabe que existen, por lo tanto, puede ejecutarlas cuando las llama. Para definir una función necesitamos escribir esta fórmula básica de código: ```python def myFunctionName(parameter, parameter2, ...parameterX): - # the function code here + # codigo de la función aquí return something ``` La palabra `def` es una palabra reservada en Python, esto significa que solo se usa para definir una función. -**El nombre** de la función podría ser lo que quieras. Consejo: usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función -y lo que devuelve-. -Nombres de ejemplo: add_two_integers , calculate_taxes , get_random_number, etc. +**El nombre** de la función podría ser lo que quieras. -**Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. La cantidad de parámetros dependerá de las operaciones realizadas dentro de la función. Ejemplo: si la función está agregando dos enteros (3 + 4), esto significa que la función necesitará dos parámetros (uno para cada entero). +*Consejo:* usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función -y lo que devuelve-. -**Ámbito:** Todo el código que contenga la función debe tener una sangría a la derecha, todo lo que esté en una sangría diferente no será considerado como parte de la función, esto se llama **ámbito**, y puede ser local (dentro de la función) y global (fuera de la función). +Nombres de ejemplo: `add_two_integers` (suma dos números enteros, `calculate_taxes` (calcular impuestos) , `get_random_number` (obtener número aleatorio), etc. -**El retorno**: no todas las funciones necesitan devolver algo, pero se recomienda que lo haga. -Consejo: devolviendo `None` es un buen valor por defecto para cuando, aún, no sabes si se necesita devolver algo. +**Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. + +La cantidad de parámetros dependerá de las operaciones realizadas dentro de la función. + +Ejemplo: si la función está sumando dos enteros (3 + 4), esto significa que la función necesitará dos parámetros (uno para cada entero). + +**Alcance:** Todo el código que contenga la función debe tener una sangría a la derecha, todo lo que esté en una sangría diferente no será considerado como parte de la función, a esto se llama **alcance**, y puede ser local (dentro de la función) y global (fuera de la función). + +**El retorno**: no todas las funciones necesitan devolver algo, pero se recomienda que lo hagan. + +*Consejo*: devolver `None` es un buen valor por defecto para cuando, aún, no sabes si tu función debe devolver algo. Ejemplo de una función: @@ -32,12 +40,14 @@ def concatenate_number_to_string(local_number, local_string): ``` -# 📝 Instrucciones: +## 📝 Instrucciones: + +1. Define una función llamada `multi`. + +2. La función `multi` recibe dos números. -1. Define una función llamada "multi". -2. La función múltiple recibe dos números 3. Devuelve el resultado de la multiplicación entre ellos. -# 💡 Pista: +## 💡 Pista: -Recuerda agregar la línea de `return`. Cada función debe devolver algo. En este caso debería ser el resultado de la multiplicación. ++ Recuerda agregar la línea de `return`. Una función siempre debería devolver algo. En este caso debería ser el resultado de la multiplicación. diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index e81637d..d67dff2 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -47,10 +47,12 @@ def concatenate_number_to_string(local_number, local_string): # 📝 Instructions: -1. Define a function called "multi". -2. Multi function receive two numbers +1. Define a function called `multi`. + +2. The `multi` function receives two numbers. + 3. Return the result of the multiplication between them. -# 💡 Hint +## 💡 Hint -Remember to add the "return" line, every function must return something, in this case it should be the result of the multiplication. ++ Remember to add the `return` line. Every function should return something, in this case it should be the result of the multiplication. diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/06-lambda-functions/README.es.md index 246bca6..a12cdf6 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/06-lambda-functions/README.es.md @@ -1,33 +1,39 @@ # `06` Funciones Lambda en Python -Una función lambda es una función con solo una línea de código y sin nombre. -Es un tipo de función muy especial en el mundo Python porque puedes usarla como una pequeña utilidad para una programación muy ágil: +Una **función lambda** es una función con solo una línea de código y sin nombre. + +Es un tipo de función muy especial en el mundo Python porque puedes usarla como una 'pequeña utilidad' para una programación muy ágil: ```python -# declaring a normal funcion for multiplication +# declarando una función normal para una multiplicación def multiply(p1, p2): return p1 * p2 -# declaring it now like a one line lambda +# declarándola en una línea como una función lambda multiply = lambda p1,p2: p1 * p2 ``` -1. Las funciones lambda tiene que ser siempre muy pequeñas -2. Las funciones lambda pueden tener únicamente una línea -3. Las funciones lambda no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor. -4. Las funciones lambda can be stored in variables or passed as parameters to another function +1. Las **funciones lambda** tiene que ser siempre muy pequeñas. + +2. Las **funciones lambda** pueden tener únicamente una línea. + +3. Las **funciones lambda** no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor. + +4. Las **funciones lambda** pueden almacenarse en variables o ser pasadas como parámetro a otra función. + + +## 📝 Instrucciones: -# 📝 Instrucciones: +1. Crea una variable llamada `is_odd`. -1. Crea una variable llamada `is_odd` -2. Asígnale una función lambda que devuelva True o False dependiendo de si un número dado es impar o no +2. Asígnale una función lambda que devuelva `True` o `False` dependiendo de si un número dado es impar o no. -## 💡 Ayuda: +## 💡 Pista: -Así es como declararías una función normal ++ Así es como declararías una función normal: ```python -# this function return True if a number is odd. +# Esta función retorna `True` si el número es impar def is_odd(num): return (num % 2) != 0 ``` diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 3866aeb..6342107 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -5,7 +5,8 @@ tutorial: "https://www.youtube.com/watch?v=HACQ9uerCuE" # `06` Lambda functions in Python -A lambda function is a function with just one line of code and no name. +A **lambda function** is a function with just one line of code and no name. + It is a very special type of funcion in the world of python because you can use it as a small utility for very agile coding: ```python @@ -16,20 +17,25 @@ def multiply(p1, p2): # declaring it now like a one line lambda multiply = lambda p1,p2: p1 * p2 ``` +:point_uo:Facts: + ++ **Lambda fuctions** have to be always very small. + ++ **Lambda function** can only have one line. + ++ **Lambda function** don't need a `return` statement (it is assumed that it will return whatever is on that one line). + ++ **Lambda functions** can be stored in variables or passed as parameters to another function -1. Lambda fuctions have to be always very small -2. Lambda function can only have one line -3. Lambda don't need a `return` statement, it is assumed that it will return whatever is on that one line. -4. Lambda functions can be stored in variables or passed as parameters to another function +## 📝 Instructions: -# 📝 Instructions: +1. Create a variable called `is_odd`. -1. Create a variable called `is_odd` -2. Assign a lambda function to it that returns True or False if a given number is odd +2. Assign a **lambda function** to it that returns `True` or `False` if a given number is odd. ## 💡Hint -Here is how you would declare it like a normal function ++ Here is how you would declare it like a normal function: ```python # this function return True if a number is odd. diff --git a/exercises/07-lambda-function-two/README.es.md b/exercises/07-lambda-function-two/README.es.md index 0a57ebd..e9f470b 100644 --- a/exercises/07-lambda-function-two/README.es.md +++ b/exercises/07-lambda-function-two/README.es.md @@ -1,6 +1,8 @@ # `07` Funciones Lambda -Apunta y toma nota + +**:point_up: Recuerda:** + Las funciones Lambda permiten una sintaxis corta para escribir expresiones de funciones. ```python @@ -8,11 +10,12 @@ multy = lambda x, y: x * y print(multy(2,2)) ``` -# 📝 Instrucciones: +## 📝 Instrucciones: + +1. Crea una función lambda llamada `rapid` que tendrá un parámetro de string. -1. Crea una función lambda llamada `rapid` que tendrá un parámetro de string -2. Devuelve el mismo string pero eliminándole la última letra +2. Devuelve el mismo string pero eliminándole la última letra. -# 💡 Sugerencia +## 💡 Pista: -Busca en Google "remove last letter form string python" (puedes usar los corchetes) ++ Busca en Google "remove last letter form string python" (puedes usar los corchetes). diff --git a/exercises/07-lambda-function-two/README.md b/exercises/07-lambda-function-two/README.md index 70c479f..69fa2ce 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/07-lambda-function-two/README.md @@ -4,7 +4,8 @@ tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" # `07` Lambda functions -Take aim and note +**:point_up: Remember:** + Lambda functions allows a short syntax for writing function expressions. ```python @@ -12,11 +13,12 @@ multy = lambda x, y: x * y print(multy(2,2)) ``` -# 📝 Instructions: +## 📝 Instructions: + +1. Create a lambda function called `rapid` it will take one string parameter. -1. Create a lambda function called `rapid` it will take one string parameter 2. Return the same string with the last letter removed. -# 💡 Hint +## 💡 Hint -Google how to "remove last letter form string python" (you can use the square brackets) ++ Google how to "remove last letter form string python" (you can use the square brackets). diff --git a/exercises/08-Function-that-returns/README.es.md b/exercises/08-Function-that-returns/README.es.md index ec37e28..cd6fd25 100644 --- a/exercises/08-Function-that-returns/README.es.md +++ b/exercises/08-Function-that-returns/README.es.md @@ -1,18 +1,23 @@ # `08` Funciones que devuelven -Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None` si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. Por ejemplo, en este caso en particular tenemos dos funciones disponibles: +Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None`. -```md -dollar_to_euro: que calcula el valor en euros de un valor dado en dólares. -euro_to_yen: calcula el valor en yenes de un valor dado en euros. -``` +Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. Por ejemplo, en este caso en particular tenemos dos funciones disponibles: -# 📝 Instrucciones: -Utilizando las dos funciones disponibles, imprima en la consola el valor de 137 dólares en yenes. ++ `dollar_to_euro`: que calcula el valor en euros de un valor dado en dólares. -# 💡 Ayuda ++ `euro_to_yen`: calcula el valor en yenes de un valor dado en euros. + +## 📝 Instrucciones: + +1. Utilizando las dos funciones disponibles, imprime en la consola el valor de **137** dólares en yenes. + +## 💡 Pista: Trabajando al revés: -- Nuestro valor esperado está en yenes. -- Nuestra función disponible euro_to_yen proporcionará eso -- Para llegar al euro utilizaremos la función disponible dollar_to_euro. \ No newline at end of file + +- Nuestro valor esperado está en yenes. + +- Nuestra función disponible `euro_to_yen` proporcionará eso. + +- Para llegar al euro utilizaremos la función disponible `dollar_to_euro`. \ No newline at end of file diff --git a/exercises/08-Function-that-returns/README.md b/exercises/08-Function-that-returns/README.md index 200ec12..cd56ca6 100755 --- a/exercises/08-Function-that-returns/README.md +++ b/exercises/08-Function-that-returns/README.md @@ -4,21 +4,27 @@ tutorial: "https://www.youtube.com/watch?v=-tqNmngh1PE" # `08` Functions that return -It is very good practice that all functions return something, even if it is `None`. With your function returns, you can create algorithms that use multiple functions at the same time. +It is very good practice that all functions return something, even if it is `None`. + +With what your function returns, you can create algorithms that use multiple functions at the same time. For example, in this particular case we have two functions available: -```md -dollar_to_euro: that calculates the value in euros of a given value in dollars. -euro_to_yen: calculates the value in yen of a given value in euros. -``` ++ `dollar_to_euro`: that calculates the value in euros of a given value in dollars. + ++ `euro_to_yen`: calculates the value in yen of a given value in euros. + + +## 📝 Instructions: -# 📝 Instructions: -Using the two functions available, print on the console the value of 137 dollars in yen. +1. Using the two functions available, print on the console the value of **137** dollars in yen. -# 💡 Hint +## 💡 Hint Working backwards: + - Our expected value is in yen. -- Our available function euro_to_yen will provide that -- To get to euro we will use the available function dollar_to_euro. + +- Our available function `euro_to_yen` will provide that. + +- To get to euro we will use the available function `dollar_to_euro`. diff --git a/exercises/09-Function-parameters/README.es.md b/exercises/09-Function-parameters/README.es.md index 9059169..6500706 100644 --- a/exercises/09-Function-parameters/README.es.md +++ b/exercises/09-Function-parameters/README.es.md @@ -1,15 +1,19 @@ # `09` Parámetros de funciones -Puedes especificar tantos parámetros como desees en una función. Como desarrollador/a, encontrarás funciones con, incluso, 6 o 7 parámetros todo el tiempo. Los nombres de los parámetros no importan, pero debe ser lo más explícito posible porque esos nombres darán pistas a los otros desarrolladores (o a ti en el futuro) sobre de qué se trata cada parámetro. +Puedes especificar tantos parámetros como desees en una función. -# 📝 Instrucciones: +Como desarrollador/a, encontrarás funciones con, incluso, 6 o 7 parámetros todo el tiempo. -- Escribe la función "render_person" requerida para imprimir un string como el siguiente: +Los nombres de los parámetros no importan, pero debe ser **lo más explícito posible** porque esos nombres darán pistas a los otros desarrolladores (o a ti en el futuro) sobre de qué trata cada parámetro. -```md +## 📝 Instrucciones: + ++ Escribe la función `render_person` requerida para imprimir un string como el siguiente: + +```py Bob is a 23 years old male born in 05/22/1983 with green eyes ``` -# 💡 Pista +## 💡 Pista - Tienes que hacer una concatenación de string y devolver ese string. diff --git a/exercises/09-Function-parameters/README.md b/exercises/09-Function-parameters/README.md index 51995c9..1301c1a 100755 --- a/exercises/09-Function-parameters/README.md +++ b/exercises/09-Function-parameters/README.md @@ -4,15 +4,20 @@ tutorial: "https://www.youtube.com/watch?v=uaiDxW4LJNA" # `09` Function parameters -You can specify as many parameters as you want in a function. As a developer you are going to find functions with even 6 or 7 parameters all the time. The names of the parameters don't matter, but you have to be as explicit as you can because these names will give clues to the other developers (or yourself in the future) about what is each parameter about. +You can specify as many parameters as you want in a function. -# 📝 Instructions: -Please write the `render_person` function required to print a a string like the following: +As a developer you are going to find functions with even 6 or 7 parameters all the time. -```md +The names of the parameters don't matter, but you have to be **as explicit as you can** because these names will give clues to the other developers (or yourself in the future) about what is each parameter about. + +## 📝 Instructions: + +1. Please write the `render_person` function required to print a a string like the following: + +```py Bob is a 23 years old male born in 05/22/1983 with green eyes ``` -# 💡 Hint +## 💡 Hint -You have to do some string concatenation and return that string. ++ You have to do some string concatenation and return that string. diff --git a/exercises/10-Array-Methods/README.es.md b/exercises/10-Array-Methods/README.es.md index 392d979..938c2ad 100644 --- a/exercises/10-Array-Methods/README.es.md +++ b/exercises/10-Array-Methods/README.es.md @@ -1,13 +1,13 @@ # `10` Métodos de listas -# 📝 Instrucciones: +## 📝 Instrucciones: -- Escribe una función llamada sort_names que dada una lista de nombres, los devuelva en orden alfabético. +1. Escribe una función llamada `sort_names` que dada una lista de nombres, los devuelva en orden alfabético. -# 💡 Pista +## 💡 Pista: -- Cada lista viene con funciones predeterminadas que permiten la ordenación, ¡úsalas dentro de tu función! +- Cada lista viene con funciones predeterminadas que permiten ordenarla ¡úsalas dentro de tu función! -¿Atrapado en el ordenamiento? Lee la página de W3 Schools sobre ordenar los listas: ++ ¿Atrapado en el orden? Lee esta página sobre cómo ordenar listas: -https://www.w3schools.com/python/ref_list_sort.asp \ No newline at end of file +https://www.freecodecamp.org/espanol/news/python-ordenar-lista-con-sort-ascendente-y-descendente-explicado-con-ejemplos/ \ No newline at end of file diff --git a/exercises/10-Array-Methods/README.md b/exercises/10-Array-Methods/README.md index bed341a..26cc991 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/10-Array-Methods/README.md @@ -5,12 +5,14 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" # `10` List Methods -# 📝 Instructions: -Write a function called sort_names that, given a list of names, returns them in alphabetical order. +## 📝 Instructions: -# 💡 Hint -Every array comes with default functions that allows sorting- use it inside your function! +1. Write a function called `sort_names` that, given a list of names, returns them in alphabetical order. -Stuck on sorting? Read W3 Schools page on sorting lists: +## 💡 Hint + ++ Every list comes with default functions that allows sorting- use it inside your function! + ++ Stuck on sorting? Read W3 Schools page on sorting lists: https://www.w3schools.com/python/ref_list_sort.asp From 344f25997a377aa9cb1790092c7c5b697f0679d7 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 4 Oct 2021 13:51:07 -0400 Subject: [PATCH 017/165] Update tests.py --- exercises/07-lambda-function-two/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-lambda-function-two/tests.py b/exercises/07-lambda-function-two/tests.py index 5d7e42b..39787f2 100755 --- a/exercises/07-lambda-function-two/tests.py +++ b/exercises/07-lambda-function-two/tests.py @@ -12,8 +12,8 @@ def test_declare_variable(): def test_for_callable(capsys): from app import rapid -@pytest.mark.it('The function rapid must receive one string and return the same but without the last letter and uppercase') +@pytest.mark.it('The function rapid must receive one string and return the same but without the last letter (make sure it\'s lowecase)') def test_for_integer(capsys): from app import rapid assert rapid("maria") == "mari" - assert rapid("pepe") == "pep" \ No newline at end of file + assert rapid("pepe") == "pep" From 0bdffedbba0357bd4aa13c39fa10e6bc84bc631c Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Sat, 9 Oct 2021 13:49:31 -0400 Subject: [PATCH 018/165] learnpack audit's action added to the repository --- .github/workflows/learnpack-audit.yml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/learnpack-audit.yml diff --git a/.github/workflows/learnpack-audit.yml b/.github/workflows/learnpack-audit.yml new file mode 100644 index 0000000..70f416e --- /dev/null +++ b/.github/workflows/learnpack-audit.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Learnpack audit + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install learnpack -g + - run: learnpack audit \ No newline at end of file From b83fcc6d48457b29ac20ed476825069c69a39669 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Thu, 28 Oct 2021 23:08:37 +0000 Subject: [PATCH 019/165] Editor version updated --- learn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learn.json b/learn.json index 662a28c..20f1886 100644 --- a/learn.json +++ b/learn.json @@ -9,7 +9,7 @@ "graded": true, "config": { "editor": { - "version": "1.0.70" + "version": "1.0.71" } } } From 3b6aa7dac793d7de44beb76d6ea6d1d967ac83f1 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Sun, 31 Oct 2021 01:13:47 +0000 Subject: [PATCH 020/165] Learnpack clean fixed by updating learnpack --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 629e22c..9f4c60a 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack@0.1.14 && learnpack plugins:install learnpack-python@0.0.35 +RUN npm i -g learnpack@0.1.17 && learnpack plugins:install learnpack-python@0.0.35 From 927ddd09906271e93f5290de01c00611f3a0f75d Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:58:14 -0400 Subject: [PATCH 021/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 9f4c60a..f5ed827 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack@0.1.17 && learnpack plugins:install learnpack-python@0.0.35 +RUN npm i -g learnpack@0.1.19 && learnpack plugins:install learnpack-python@0.0.35 From 05ef8e3af4e8c243c0a75ddacb552af1b8673ee7 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:22:13 -0400 Subject: [PATCH 022/165] Update README.es.md --- exercises/01-hello-world/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/01-hello-world/README.es.md b/exercises/01-hello-world/README.es.md index 59194e2..7f288fa 100644 --- a/exercises/01-hello-world/README.es.md +++ b/exercises/01-hello-world/README.es.md @@ -2,7 +2,7 @@ ¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 -Presiona `Next` `Next →` de arriba a la derecha cuando quieras empezar. +Presiona `Next →` en la esquina superior derecha cuando quieras empezar. En este curso aprenderás los siguientes conceptos: @@ -10,7 +10,7 @@ En este curso aprenderás los siguientes conceptos: 2. Construir tus primeras **funciones.** -3. Sentirte cómod@ usando **funciones Lambda** en Python +3. Sentirte cómod@ usando **funciones Lambda** en Python. 4. Construir **funciones** con parámetros. From 5c3914cec05bd35ff344414ebbba94750829d476 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:23:32 -0400 Subject: [PATCH 023/165] Update README.es.md --- exercises/02-Hello-World/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index 9710f1a..0e91c64 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -2,7 +2,7 @@ En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) en algo llamado `la consola`. -Cada idioma tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza(`print`) sobre todo como herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. +Cada idioma tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza (`print`) sobre todo como herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. Este es un ejemplo de cómo usarlo From 57ec31e6e01526ae74dbf824e88b063efcdeb093 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:26:18 -0400 Subject: [PATCH 024/165] Update README.es.md --- exercises/04-Call-a-function/README.es.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/exercises/04-Call-a-function/README.es.md b/exercises/04-Call-a-function/README.es.md index f0247c0..d83a677 100644 --- a/exercises/04-Call-a-function/README.es.md +++ b/exercises/04-Call-a-function/README.es.md @@ -27,10 +27,7 @@ area = calculate_area(3,6) ## 📝 Instrucciones: - -1. Create a new variable named `square_area1`, `square_area2`, `square_area3` and call the function `calculate_area` three times one for each square in the picture, for example: - -1. Crea nuevas variables llamadas `squareArea1`, `square_area2`, `square_area3` y llama a la función `CalculateArea` 3 veces, un por cada cuadrador en la foto, utilizando las dimensiones de la figura, por ejemplo: +1. Crea nuevas variables llamadas `squareArea1`, `square_area2`, `square_area3` y llama a la función `CalculateArea` 3 veces, un por cada cuadrado en la foto, utilizando las dimensiones de la figura, por ejemplo: ```python # para la primera figura: From 6f4e342d48adc17f2577eeac3e05dc5f2018066d Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:29:35 -0400 Subject: [PATCH 025/165] Update README.es.md --- exercises/05-Defining-vs-Calling-a-function/README.es.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.es.md b/exercises/05-Defining-vs-Calling-a-function/README.es.md index b4d2d60..d193398 100644 --- a/exercises/05-Defining-vs-Calling-a-function/README.es.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.es.md @@ -14,9 +14,9 @@ La palabra `def` es una palabra reservada en Python, esto significa que solo se **El nombre** de la función podría ser lo que quieras. -*Consejo:* usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función -y lo que devuelve-. +*Consejo:* usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función (y lo que devuelve). -Nombres de ejemplo: `add_two_integers` (suma dos números enteros, `calculate_taxes` (calcular impuestos) , `get_random_number` (obtener número aleatorio), etc. +Nombres de ejemplo: `add_two_integers` (suma dos números enteros), `calculate_taxes` (calcular impuestos) , `get_random_number` (obtener número aleatorio), etc. **Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. @@ -32,7 +32,6 @@ Ejemplo: si la función está sumando dos enteros (3 + 4), esto significa que la Ejemplo de una función: - ```python def concatenate_number_to_string(local_number, local_string): local_variable = local_string+""+str(local_number) From 4aa1c7718b8e806304546469864c3babd99115f8 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 6 Dec 2021 15:30:12 -0400 Subject: [PATCH 026/165] Update README.md --- exercises/05-Defining-vs-Calling-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index d67dff2..3a826e3 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -49,7 +49,7 @@ def concatenate_number_to_string(local_number, local_string): 1. Define a function called `multi`. -2. The `multi` function receives two numbers. +2. The `multi` function receives two numbers. 3. Return the result of the multiplication between them. From d443683f143f6b07e1a72631b8209f68086bc50c Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Wed, 22 Dec 2021 22:51:55 -0400 Subject: [PATCH 027/165] coding ide version changed to 1.0.72 --- learn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learn.json b/learn.json index 20f1886..5169f15 100644 --- a/learn.json +++ b/learn.json @@ -9,7 +9,7 @@ "graded": true, "config": { "editor": { - "version": "1.0.71" + "version": "1.0.72" } } } From 8c8170682ab3f66b6b796547c20cfa9d16ecdab4 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Fri, 14 Jan 2022 19:16:14 +0000 Subject: [PATCH 028/165] https://github.com/learnpack/learnpack/issues/512 --- .learn/resets/06-lambda-functions/app.py | 2 ++ exercises/06-lambda-functions/README.md | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .learn/resets/06-lambda-functions/app.py diff --git a/.learn/resets/06-lambda-functions/app.py b/.learn/resets/06-lambda-functions/app.py new file mode 100644 index 0000000..e59626e --- /dev/null +++ b/.learn/resets/06-lambda-functions/app.py @@ -0,0 +1,2 @@ +# your function here + diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 6342107..656de47 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -37,9 +37,9 @@ multiply = lambda p1,p2: p1 * p2 + Here is how you would declare it like a normal function: -```python +```py # this function return True if a number is odd. def is_odd(num): - return (num % 2) !== 0: + return (num % 2) != 0: ``` -  + From dbea562ea22a3cc07e008c4cbea72c704e54f504 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Thu, 20 Jan 2022 14:10:22 -0400 Subject: [PATCH 029/165] Update README.md --- exercises/06-lambda-functions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 656de47..66c8498 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -40,6 +40,6 @@ multiply = lambda p1,p2: p1 * p2 ```py # this function return True if a number is odd. def is_odd(num): - return (num % 2) != 0: + return num % 2 != 0 ``` From 04dbe7e15d20e010389cbafa65c6db0f7bf15328 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Fri, 21 Jan 2022 18:24:50 +0000 Subject: [PATCH 030/165] learnpack clean --- .learn/resets/06-lambda-functions/app.py | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .learn/resets/06-lambda-functions/app.py diff --git a/.learn/resets/06-lambda-functions/app.py b/.learn/resets/06-lambda-functions/app.py deleted file mode 100644 index e59626e..0000000 --- a/.learn/resets/06-lambda-functions/app.py +++ /dev/null @@ -1,2 +0,0 @@ -# your function here - From 652a4bb82e228758cadd2aea2416563d389d0dae Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 24 Jan 2022 15:46:37 -0400 Subject: [PATCH 031/165] Update learn.json --- learn.json | 1 + 1 file changed, 1 insertion(+) diff --git a/learn.json b/learn.json index 5169f15..1bfa239 100644 --- a/learn.json +++ b/learn.json @@ -1,5 +1,6 @@ { "title": "Learn Python Functions Interactively", + "slug": "python-function-exercises", "repository": "https://github.com/4GeeksAcademy/python-functions-programming-exercises", "preview": "https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/preview.gif?raw=true", "description": "Learn and master functional programing by doing auto-graded interactive exercises.", From 8df11c7fe5cc07d9c2f74e507c967760c46252f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Su=C3=A1rez?= Date: Wed, 9 Feb 2022 01:48:11 +0000 Subject: [PATCH 032/165] 04-Call-a-function --- exercises/04-Call-a-function/README.es.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exercises/04-Call-a-function/README.es.md b/exercises/04-Call-a-function/README.es.md index d83a677..e04cd13 100644 --- a/exercises/04-Call-a-function/README.es.md +++ b/exercises/04-Call-a-function/README.es.md @@ -1,3 +1,6 @@ +--- +tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" +--- # `04` Llamando a una función Una función podría recibir 0 parámetros y tú puedes devolver algo siempre, incluso si no añades explícitamente el `return`. From ae4b87497c95d704c6167a3d369057eff64fea69 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Tue, 29 Mar 2022 18:53:10 +0000 Subject: [PATCH 033/165] https://github.com/learnpack/learnpack/issues/811 --- README.es.md | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 16 +++++---- 2 files changed, 104 insertions(+), 7 deletions(-) create mode 100644 README.es.md diff --git a/README.es.md b/README.es.md new file mode 100644 index 0000000..076587f --- /dev/null +++ b/README.es.md @@ -0,0 +1,95 @@ + + + + + +
+

🐍 Turorial y Ejercicioa sobre Funciones de Python

+

Por @alesanchezr y otros colaboradores at 4Geeks Academy

+ + + follow on Twitter + +
+ +Aprende y practica las funciones de Python. Aprenderás los siguientes conceptos: + +1. Declarar una función, + +2. llamar a una función, + +3. alcances de funciones, + +4. funciones anidadad + +5. recursividad de funciones y muchos otros conceptos funcionales. + +Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. + +

📚 Tabla de contenidos

+ + + + + + + + + + + + +
1. Python para Principiantes
2. Practica Loops en Listas y Tuplas
3. Practica funciones← 🔥 estás aquí
4. Master Python (intermediate)
5. Python API Requests
6.¿Qué sigue? Solicita un nuevo tutorial o colabora.
Añadiremos tu perfil a nuestra lista de colaboradores
+ +Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error o falta de ortografía, por favor contribuye y repórtalo. + +

+ +

+ +## Instalación en un clic: + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) + + +## Local Installation + +1) Asegúrate de instalar [learnpack](https://learnpack.co), `node.js` version 14+ y python version 3+. Este es el comando para instalar learnpack: + +``` +$ npm i learnpack -g && learnpack plugins:install learnpack-python +``` + +2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás un carpeta nueva con un subdirectorio "exercises" que contiene los ejercicios. + +``` +$ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git +``` + +3) Comienza el tutorial/ejercicios ejecutando el siguiente comando en la raíz del proyecto: + +```sh +$ cd python-functions-programming-exercises +$ pip install pytest==4.4.2 mock pytest-testdox +$ learnpack start +``` + +## ¿Cómo están organizados los ejercicios? + +Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes archivos: + +1. **app.py:** representa el archivo de entrada de python que será ejecutado en el computador. +2. **README.md:** contiene las instrucciones del ejercicio. +3. **test.py:** no tienes que abrir este archivo. Contiene los scripts de pruebas del ejercicio. + +## Colaboradores + +Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): + +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻 (idea) 🤔, (build-tests) ⚠️ , (pull-request-review) 🤓 (build-tutorial) ✅ (documentación) 📖 + +2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (programador), (traducción) 🌎 + +3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (translation) 🌎 + +Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! \ No newline at end of file diff --git a/README.md b/README.md index 3c46c2f..6af3d8a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ These exercises were built in collaboration, we need you! If you find any bugs o

-

One click installation:

+## One click installation: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) @@ -44,6 +44,7 @@ These exercises were built in collaboration, we need you! If you find any bugs o 1) Make sure you have [learnpack](https://learnpack.co) installed, `node.js` version 14+ and python version 3+. This is the command to install learnpack: ``` + $ npm i learnpack -g && learnpack plugins:install learnpack-python ``` @@ -73,10 +74,11 @@ Each exercise is a small react application containing the following files: Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book: -2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) :bug:, contribution: (coder), (translation) :earth_americas: -3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) :bug:, (translation) :earth_africa: +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻 (idea) 🤔, (build-tests) ⚠️ , (pull-request-review) 👀 (build-tutorial) ✅ (documentation) 📖 + +2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) 🐛, contribution: (coder), (translation) 🌎 + +3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) :🐛, (translation) 🌎 + -This project follows the -[all-contributors](https://github.com/kentcdodds/all-contributors) -specification. Contributions of any kind are welcome! +This project follows the[all-contributors](https://github.com/kentcdodds/all-contributors) specification.Contributions of any kind are welcome! From c4acb5006870617596a8984cc24810af212f491c Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Tue, 29 Mar 2022 19:10:38 +0000 Subject: [PATCH 034/165] misspell --- README.es.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.es.md b/README.es.md index 076587f..eb6ddc1 100644 --- a/README.es.md +++ b/README.es.md @@ -51,8 +51,7 @@ Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) - -## Local Installation +## Instalación local: 1) Asegúrate de instalar [learnpack](https://learnpack.co), `node.js` version 14+ y python version 3+. Este es el comando para instalar learnpack: From 3e0b05a960f1f09aee38ec702ad9bb08e2e6c650 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Tue, 29 Mar 2022 23:07:30 +0000 Subject: [PATCH 035/165] missing content --- README.es.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.es.md b/README.es.md index eb6ddc1..10a3067 100644 --- a/README.es.md +++ b/README.es.md @@ -73,6 +73,8 @@ $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` +Nota: Estos ejercicios tienen calificación automática pero es un tanto rígida, te recomiendo ignorar los tests, considéralos como una recomendación o podrías frustrarte. + ## ¿Cómo están organizados los ejercicios? Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes archivos: diff --git a/README.md b/README.md index 6af3d8a..85a0314 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` +Note: The exercises have automatic grading but its very rigid and string, my recomendation is to ignore the tests and use them only as a recomendation or you can get frustrated. + ## How are the exercises organized? Each exercise is a small react application containing the following files: From 1c2549e636c33a9413f731b3e9a93bc88ea1fa2c Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Wed, 30 Mar 2022 19:43:11 +0000 Subject: [PATCH 036/165] badge added --- README.es.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.es.md b/README.es.md index 10a3067..a3a3bf8 100644 --- a/README.es.md +++ b/README.es.md @@ -1,3 +1,5 @@ + + diff --git a/README.md b/README.md index 85a0314..a8da560 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + +
From a54cb3d2666d104c6356ee2442c9150f2167e9da Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Wed, 30 Mar 2022 19:45:05 +0000 Subject: [PATCH 037/165] badge --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index a8da560..fd529c5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ - -

🐍 Python Funtions Tutorial and Exercises

-

By @alesanchezr and other contributors at 4Geeks Academy

+

By @alesanchezr and other contributors at 4Geeks Academy

follow on Twitter From 1c077c501d6b0f69f068ad9663dbd0ed7eb33041 Mon Sep 17 00:00:00 2001 From: Elvira Quiroz Date: Wed, 30 Mar 2022 19:46:57 +0000 Subject: [PATCH 038/165] badge uploaded --- README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.es.md b/README.es.md index a3a3bf8..866bf09 100644 --- a/README.es.md +++ b/README.es.md @@ -5,7 +5,7 @@

🐍 Turorial y Ejercicioa sobre Funciones de Python

-

Por @alesanchezr y otros colaboradores at 4Geeks Academy

+

Por @alesanchezr y otros colaboradores at 4Geeks Academy

follow on Twitter From 5b6f91a5d462eacb7469bc5305cef2743423494b Mon Sep 17 00:00:00 2001 From: Lorenagubaira Date: Fri, 22 Apr 2022 15:21:48 +0000 Subject: [PATCH 039/165] =?UTF-8?q?the=20main=20README=C2=B4s=20were=20cha?= =?UTF-8?q?nged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.es.md | 41 +++++++++++++++++++++++++++-------------- README.md | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/README.es.md b/README.es.md index 866bf09..438eaca 100644 --- a/README.es.md +++ b/README.es.md @@ -1,11 +1,10 @@ - + -
-

🐍 Turorial y Ejercicioa sobre Funciones de Python

-

Por @alesanchezr y otros colaboradores at 4Geeks Academy

+

🐍 Turorial y Ejercicios sobre Funciones de Python

+

Por @alesanchezr y otros colaboradores at 4Geeks Academy

follow on Twitter @@ -13,20 +12,32 @@
+ + + + + +
+

+Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: -Aprende y practica las funciones de Python. Aprenderás los siguientes conceptos: - -1. Declarar una función, +1. Declarar una función. -2. llamar a una función, +2. Llamar a una función. -3. alcances de funciones, +3. Alcances de funciones. -4. funciones anidadad +4. Funciones añadidas. -5. recursividad de funciones y muchos otros conceptos funcionales. +5. Recursividad de funciones y muchos otros conceptos funcionales. Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. +

+
+ +
+ +

📚 Tabla de contenidos

@@ -49,7 +60,7 @@ Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error

-## Instalación en un clic: +## Instalación en un clic: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) @@ -93,6 +104,8 @@ Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds 2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (programador), (traducción) 🌎 -3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (translation) 🌎 +3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (traducción) 🌎 + +Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). -Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! \ No newline at end of file + ¡Todas las contribuciones son bienvenidas! \ No newline at end of file diff --git a/README.md b/README.md index fd529c5..1299848 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@
-
-

🐍 Python Funtions Tutorial and Exercises

-

By @alesanchezr and other contributors at 4Geeks Academy

+

🐍 Python Functions Tutorial and Exercises

+

By @alesanchezr and other contributors at 4Geeks Academy

follow on Twitter @@ -12,7 +11,33 @@
-Learn and practice Python Functions: Declaring a functoin, Calling a function, function scopes, nest functions, function recursivity and many other functional concepts. The entire tutorial is 👆 interactive, ✅ auto-graded and with. 📹 video tutorials. + +
+ + + + + +
+

+Learn and practice Python Functions. You will see the folowing concepts: + +1. Declaring a function. + +2. Calling a function. + +3. Function scopes. + +4. Nest functions. + +5. Function recursivity, and many other functional concepts. + +The entire tutorial is 👆 interactive, ✅ auto-graded and with. 📹 video tutorials. +

+
+ +
+

📚 Table of contents:

@@ -29,7 +54,7 @@ Learn and practice Python Functions: Declaring a functoin, Calling a function, f
6. What next? Request a new tutorial or collaborate.
We will feature your profile in our list of contributors
-These exercises were built in collaboration, we need you! If you find any bugs or misspells plese contribute and report them. +These exercises were built in collaboration, we need you! If you find any bugs or misspells please contribute and report them.

@@ -43,8 +68,8 @@ These exercises were built in collaboration, we need you! If you find any bugs o ## Local Installation 1) Make sure you have [learnpack](https://learnpack.co) installed, `node.js` version 14+ and python version 3+. This is the command to install learnpack: -``` +``` $ npm i learnpack -g && learnpack plugins:install learnpack-python ``` @@ -74,7 +99,7 @@ Each exercise is a small react application containing the following files: ## Contributors -Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): +Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): 1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻 (idea) 🤔, (build-tests) ⚠️ , (pull-request-review) 👀 (build-tutorial) ✅ (documentation) 📖 @@ -83,4 +108,6 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds 3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) :🐛, (translation) 🌎 -This project follows the[all-contributors](https://github.com/kentcdodds/all-contributors) specification.Contributions of any kind are welcome! +This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. + +Contributions of any kind are welcome! From 6fbb75b0ec37c09df3850ef43a6714463c235dd1 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 25 Apr 2022 19:07:41 -0400 Subject: [PATCH 040/165] Update README.md --- README.md | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index fd529c5..7d9e027 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,21 @@ - - - - - -
-

🐍 Python Funtions Tutorial and Exercises

-

By @alesanchezr and other contributors at 4Geeks Academy

- - - follow on Twitter - -
- -Learn and practice Python Functions: Declaring a functoin, Calling a function, function scopes, nest functions, function recursivity and many other functional concepts. The entire tutorial is 👆 interactive, ✅ auto-graded and with. 📹 video tutorials. - -

📚 Table of contents:

- - - - - - - - - - - - -
1. Python for Beginners
2. Practice Looping Lists and Tuples
3. Practice functions← 🔥 your are here now
4. Master Python (intermediate)
5. Python API Requests
6. What next? Request a new tutorial or collaborate.
We will feature your profile in our list of contributors
+ +# 🐍 Python Funtions Tutorial and Exercises + +By @alesanchezr and other contributors at 4Geeks Academy + +Learn and practice Python Functions: + +- Declaring a functoin, +- Calling a function +- Function scopes +- Nested functions, +- Recursivity + +Note: The entire tutorial is 👆 interactive, ✅ auto-graded and with. 📹 video tutorials. These exercises were built in collaboration, we need you! If you find any bugs or misspells plese contribute and report them. +

@@ -64,6 +49,7 @@ $ learnpack start Note: The exercises have automatic grading but its very rigid and string, my recomendation is to ignore the tests and use them only as a recomendation or you can get frustrated. + ## How are the exercises organized? Each exercise is a small react application containing the following files: From 223b1bb50cc53c58a4501d137d568590af3f468f Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 25 Apr 2022 19:08:36 -0400 Subject: [PATCH 041/165] Update README.es.md --- README.es.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/README.es.md b/README.es.md index 866bf09..b859690 100644 --- a/README.es.md +++ b/README.es.md @@ -1,18 +1,9 @@ - + +# 🐍 Turorial y Ejercicioa sobre Funciones de Python - - - - - -
-

🐍 Turorial y Ejercicioa sobre Funciones de Python

-

Por @alesanchezr y otros colaboradores at 4Geeks Academy

- - - follow on Twitter - -
+

Por @alesanchezr y otros colaboradores at 4Geeks Academy + + Aprende y practica las funciones de Python. Aprenderás los siguientes conceptos: @@ -28,6 +19,7 @@ Aprende y practica las funciones de Python. Aprenderás los siguientes conceptos Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. +

📚 Tabla de contenidos

@@ -77,6 +69,8 @@ $ learnpack start Nota: Estos ejercicios tienen calificación automática pero es un tanto rígida, te recomiendo ignorar los tests, considéralos como una recomendación o podrías frustrarte. + + ## ¿Cómo están organizados los ejercicios? Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes archivos: @@ -95,4 +89,4 @@ Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds 3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (translation) 🌎 -Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! \ No newline at end of file +Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! From 023c6177f15cab11891d3db0695330f5e78926cf Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 25 Apr 2022 19:08:56 -0400 Subject: [PATCH 042/165] Update README.es.md --- README.es.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.es.md b/README.es.md index b859690..3634f95 100644 --- a/README.es.md +++ b/README.es.md @@ -20,20 +20,6 @@ Aprende y practica las funciones de Python. Aprenderás los siguientes conceptos Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. -

📚 Tabla de contenidos

-
- - - - - - - - - - - -
1. Python para Principiantes
2. Practica Loops en Listas y Tuplas
3. Practica funciones← 🔥 estás aquí
4. Master Python (intermediate)
5. Python API Requests
6.¿Qué sigue? Solicita un nuevo tutorial o colabora.
Añadiremos tu perfil a nuestra lista de colaboradores
Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error o falta de ortografía, por favor contribuye y repórtalo. From e19bf0c5a3a396dc53018b23a3f2599e01465fd4 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Tue, 26 Apr 2022 12:21:05 -0400 Subject: [PATCH 043/165] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7d9e027..050e305 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ By @alesanchezr and @alesanchezr y otros colaboradores at 4Geeks Academy +

Por @alesanchezr y otros colaboradores at 4Geeks Academy From bbc32dcc8fde853820f78e29d1a12be69fc10a1a Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 2 May 2022 14:29:32 -0400 Subject: [PATCH 045/165] Update README.es.md --- README.es.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.es.md b/README.es.md index d80d9ca..4ce42a0 100644 --- a/README.es.md +++ b/README.es.md @@ -16,13 +16,6 @@

Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: - -# 🐍 Turorial y Ejercicioa sobre Funciones de Python - -

Por @alesanchezr y otros colaboradores at 4Geeks Academy - - - 1. Declarar una función. 2. Llamar a una función. From ac13344aa4177559945fc373103880057689dec1 Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Wed, 25 May 2022 01:45:44 +0000 Subject: [PATCH 046/165] changed ide version --- learn.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/learn.json b/learn.json index 1bfa239..90de495 100644 --- a/learn.json +++ b/learn.json @@ -8,9 +8,9 @@ "difficulty": "easy", "video-solutions": false, "graded": true, - "config": { + "editor": { - "version": "1.0.72" + "version": "1.0.73" } - } + } From cf32917b66fa62a4664227da8684666619865af2 Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Fri, 27 May 2022 03:08:15 +0000 Subject: [PATCH 047/165] @learnpack/learnpack --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index f5ed827..bccdee6 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g learnpack@0.1.19 && learnpack plugins:install learnpack-python@0.0.35 +RUN npm i -g @learnpack/learnpack && learnpack plugins:install learnpack-python@0.0.35 From f9be189303911023d7a9595990fb0309bf8cdb6b Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Fri, 17 Jun 2022 14:54:21 +0000 Subject: [PATCH 048/165] changed yml file --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index b307e19..1d3e46c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -7,7 +7,7 @@ ports: vscode: extensions: - - learnpack.learnpack-vscode + - learn-pack.learnpack-vscode github: prebuilds: From 33169cb3f33926c804ffc05f5d7fe6407bb5cfc1 Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Thu, 30 Jun 2022 14:52:09 +0000 Subject: [PATCH 049/165] added \s to test to pass when space is added --- exercises/10-Array-Methods/app.py | 1 - exercises/10-Array-Methods/solution.hide.py | 2 ++ exercises/10-Array-Methods/tests.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 exercises/10-Array-Methods/solution.hide.py diff --git a/exercises/10-Array-Methods/app.py b/exercises/10-Array-Methods/app.py index fdddc23..c88bc18 100755 --- a/exercises/10-Array-Methods/app.py +++ b/exercises/10-Array-Methods/app.py @@ -1,5 +1,4 @@ names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] ## CREATE YOUR FUNCTION HERE - print(sort_names(names)) diff --git a/exercises/10-Array-Methods/solution.hide.py b/exercises/10-Array-Methods/solution.hide.py new file mode 100644 index 0000000..f63fbd8 --- /dev/null +++ b/exercises/10-Array-Methods/solution.hide.py @@ -0,0 +1,2 @@ +def sort_names (arr): + return sorted(arr) diff --git a/exercises/10-Array-Methods/tests.py b/exercises/10-Array-Methods/tests.py index 2effdc1..9ff5658 100755 --- a/exercises/10-Array-Methods/tests.py +++ b/exercises/10-Array-Methods/tests.py @@ -5,7 +5,7 @@ def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"def sort_names\(.*\)\:") + regex = re.compile(r"def sort_names\s\(.*\)\:") assert bool(regex.search(content)) == True From 55e51a20f0f27761527f50429102d869f6d0e188 Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Thu, 30 Jun 2022 15:34:34 +0000 Subject: [PATCH 050/165] fixed test so it would read print on any line --- exercises/02-Hello-World/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/test.py b/exercises/02-Hello-World/test.py index 54698bd..808d21d 100644 --- a/exercises/02-Hello-World/test.py +++ b/exercises/02-Hello-World/test.py @@ -4,7 +4,7 @@ def test_output(): f = open(os.path.dirname(os.path.abspath(__file__)) + '/app.py') content = f.read() - assert content.find("print(") > 0 + assert content.find("print") >= 0 @pytest.mark.it('The printed value on the console should be "Hello World"') def test_for_file_output(capsys, app): From 5b3db32b54d8fcd87cafff2c0efb3cf77466b720 Mon Sep 17 00:00:00 2001 From: Sadiel0 Date: Tue, 5 Jul 2022 11:38:05 +0000 Subject: [PATCH 051/165] regex changed to allow many spaces --- exercises/10-Array-Methods/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Array-Methods/tests.py b/exercises/10-Array-Methods/tests.py index 9ff5658..57e5e91 100755 --- a/exercises/10-Array-Methods/tests.py +++ b/exercises/10-Array-Methods/tests.py @@ -5,7 +5,7 @@ def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"def sort_names\s\(.*\)\:") + regex = re.compile(r"def sort_names\s*\(.*\)\:") assert bool(regex.search(content)) == True From 08156f84506bdaa7ce83ba39ed0d5d7941b76dc7 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:05:30 -0400 Subject: [PATCH 052/165] Update tests.py --- exercises/10-Array-Methods/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Array-Methods/tests.py b/exercises/10-Array-Methods/tests.py index 57e5e91..76a6c4d 100755 --- a/exercises/10-Array-Methods/tests.py +++ b/exercises/10-Array-Methods/tests.py @@ -5,7 +5,7 @@ def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"def sort_names\s*\(.*\)\:") + regex = re.compile(r"def\s*sort_names\s*\(") assert bool(regex.search(content)) == True From 63bac30725112b16ac01dbd517ac228ec0a31093 Mon Sep 17 00:00:00 2001 From: dsilva06 Date: Wed, 27 Jul 2022 20:14:02 +0000 Subject: [PATCH 053/165] test --- .../05-Defining-vs-Calling-a-function/solution.hide.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 exercises/05-Defining-vs-Calling-a-function/solution.hide.py diff --git a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py new file mode 100644 index 0000000..1a685ad --- /dev/null +++ b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py @@ -0,0 +1,10 @@ +# Define the function called "multi" that expects 2 parameters: +def multi(num1 , num2): + total = num1 * num2 + print(total) + return total + + +# don't edit anything below this line +return_value = multi(7,53812212) +print(return_value) \ No newline at end of file From 5ce268725cc03409c46092dd0a6d170a7c505192 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Fri, 29 Jul 2022 21:39:26 +0000 Subject: [PATCH 054/165] Test improved on exercise 05 --- .../solution.hide.py | 1 - exercises/05-Defining-vs-Calling-a-function/tests.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py index 1a685ad..6a28c77 100644 --- a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py +++ b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py @@ -1,7 +1,6 @@ # Define the function called "multi" that expects 2 parameters: def multi(num1 , num2): total = num1 * num2 - print(total) return total diff --git a/exercises/05-Defining-vs-Calling-a-function/tests.py b/exercises/05-Defining-vs-Calling-a-function/tests.py index 7dd33c3..35f9e6c 100755 --- a/exercises/05-Defining-vs-Calling-a-function/tests.py +++ b/exercises/05-Defining-vs-Calling-a-function/tests.py @@ -5,13 +5,21 @@ def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"def(\s*)multi\(") + regex = re.compile(r"def\s*multi\s*\(") assert bool(regex.search(content)) == True @pytest.mark.it('The function multi must exist') def test_for_callable(capsys, app): assert callable(app.multi) +@pytest.mark.it('The function multi must return a value') +def test_for_return_something(capsys, app): + assert app.multi(1, 1) == True + @pytest.mark.it('The function multi must receive two numbers and return their multiplication') def test_for_integer(capsys, app): - assert app.multi(3,4) == 12 \ No newline at end of file + assert app.multi(3,4) == 12 + +@pytest.mark.it('The function multi must receive two numbers and return their multiplication. Testing with different values.') +def test_for_function_return(capsys, app): + assert app.multi(10, 6) == 60 \ No newline at end of file From e415cf6e4e3973f9fb60da363e143dfbf7d35c08 Mon Sep 17 00:00:00 2001 From: Chad Grubbs <98975975+Chadmichaelg@users.noreply.github.com> Date: Thu, 18 Aug 2022 15:49:59 -0400 Subject: [PATCH 055/165] Update README.md line 26. Changed the word don't to doesn't --- exercises/06-lambda-functions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 66c8498..dd38458 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -23,7 +23,7 @@ multiply = lambda p1,p2: p1 * p2 + **Lambda function** can only have one line. -+ **Lambda function** don't need a `return` statement (it is assumed that it will return whatever is on that one line). ++ **Lambda function** doesn't need a `return` statement (it is assumed that it will return whatever is on that one line). + **Lambda functions** can be stored in variables or passed as parameters to another function From 5d58b1f4005066382d8ca1c89619376710581009 Mon Sep 17 00:00:00 2001 From: dsilva06 Date: Fri, 19 Aug 2022 20:49:11 +0000 Subject: [PATCH 056/165] learnpack -v --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index bccdee6..4a63f24 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g @learnpack/learnpack && learnpack plugins:install learnpack-python@0.0.35 +RUN npm i -g @learnpack/learnpack@2.1.18 && learnpack plugins:install learnpack-python@0.0.35 From 45537933145559f8a2e40b795725899cee548176 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 22 Aug 2022 08:30:03 -0400 Subject: [PATCH 057/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 4a63f24..34855b8 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g @learnpack/learnpack@2.1.18 && learnpack plugins:install learnpack-python@0.0.35 +RUN npm i -g @learnpack/learnpack@2.1.18 && learnpack plugins:install @learnpack/python From ed26fb642d74c8912cedd6af157f361de85161f3 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Mon, 22 Aug 2022 22:20:55 -0400 Subject: [PATCH 058/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 34855b8..68ef1fb 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ FROM gitpod/workspace-full:latest USER gitpod RUN pip3 install pytest==4.4.2 pytest-testdox mock -RUN npm i -g @learnpack/learnpack@2.1.18 && learnpack plugins:install @learnpack/python +RUN npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 From 3b849b1b57a2c5c3ba20e89dda036540e5a4137b Mon Sep 17 00:00:00 2001 From: dsilva06 Date: Sat, 27 Aug 2022 22:09:50 +0000 Subject: [PATCH 059/165] =?UTF-8?q?=E2=80=9Clearnpack=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/learnpack-audit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/learnpack-audit.yml b/.github/workflows/learnpack-audit.yml index 70f416e..52644d8 100644 --- a/.github/workflows/learnpack-audit.yml +++ b/.github/workflows/learnpack-audit.yml @@ -25,5 +25,5 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - run: npm install learnpack -g + - run: npm install @learnpack/learnpack@latest -g - run: learnpack audit \ No newline at end of file From ebe189478540c9a30472961b7e4b4a62b35bc6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Su=C3=A1rez?= <82285542+kiddopro@users.noreply.github.com> Date: Sat, 8 Oct 2022 00:28:14 -0300 Subject: [PATCH 060/165] Update learn.json --- learn.json | 1 + 1 file changed, 1 insertion(+) diff --git a/learn.json b/learn.json index 90de495..3a5054f 100644 --- a/learn.json +++ b/learn.json @@ -7,6 +7,7 @@ "duration": 10, "difficulty": "easy", "video-solutions": false, + "bugs-link": "https://github.com/learnpack/learnpack/issues/new", "graded": true, "editor": { From c6e3b0f22ec3e188dff88487163cdd59bb1af290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Su=C3=A1rez?= <82285542+kiddopro@users.noreply.github.com> Date: Tue, 11 Oct 2022 22:54:55 -0300 Subject: [PATCH 061/165] camelCase --- learn.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/learn.json b/learn.json index 3a5054f..e25dadd 100644 --- a/learn.json +++ b/learn.json @@ -6,8 +6,8 @@ "description": "Learn and master functional programing by doing auto-graded interactive exercises.", "duration": 10, "difficulty": "easy", - "video-solutions": false, - "bugs-link": "https://github.com/learnpack/learnpack/issues/new", + "videoSolutions": true, + "bugsLink": "https://github.com/learnpack/learnpack/issues/new", "graded": true, "editor": { From abf52130a0f1dba4a33b9adfaf3e89a7f22b924c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Su=C3=A1rez?= <82285542+kiddopro@users.noreply.github.com> Date: Sat, 5 Nov 2022 21:43:22 -0300 Subject: [PATCH 062/165] Update learn.json --- learn.json | 1 + 1 file changed, 1 insertion(+) diff --git a/learn.json b/learn.json index e25dadd..34ad535 100644 --- a/learn.json +++ b/learn.json @@ -6,6 +6,7 @@ "description": "Learn and master functional programing by doing auto-graded interactive exercises.", "duration": 10, "difficulty": "easy", + "projectType": "tutorial", "videoSolutions": true, "bugsLink": "https://github.com/learnpack/learnpack/issues/new", "graded": true, From fbc63cef3014cb8c5edc5d8d9aada0d356a54fe0 Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Thu, 16 Feb 2023 20:56:51 +0000 Subject: [PATCH 063/165] added solution --- exercises/07-lambda-function-two/solution.hide.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 exercises/07-lambda-function-two/solution.hide.py diff --git a/exercises/07-lambda-function-two/solution.hide.py b/exercises/07-lambda-function-two/solution.hide.py new file mode 100644 index 0000000..963f084 --- /dev/null +++ b/exercises/07-lambda-function-two/solution.hide.py @@ -0,0 +1,5 @@ +rapid = lambda myStr: myStr[:-1] + + +# From this line above, plese do not change code below +print(rapid("bob")) #should print bo \ No newline at end of file From f6f360e471969828bfcab6015ff6608e2708e69b Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Fri, 17 Feb 2023 00:16:43 -0400 Subject: [PATCH 064/165] Update learn.json --- learn.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/learn.json b/learn.json index e25dadd..1536874 100644 --- a/learn.json +++ b/learn.json @@ -1,9 +1,15 @@ { - "title": "Learn Python Functions Interactively", + "title": { + "us": "Learn Python Functions Interactively", + "es": "Aprende las funciones de Python Interactivamente" + }, "slug": "python-function-exercises", "repository": "https://github.com/4GeeksAcademy/python-functions-programming-exercises", "preview": "https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/preview.gif?raw=true", - "description": "Learn and master functional programing by doing auto-graded interactive exercises.", + "description": { + "us": "Learn and master functional programing by doing auto-graded interactive exercises.", + "es": "Aprende y domina funciones en Python haciendo ejercicios interactivos y auto-evaluados." + }, "duration": 10, "difficulty": "easy", "videoSolutions": true, From 161612a3e479cdf579f1ec3e7b0bbcaca85f4755 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 13 Mar 2023 12:48:39 -0400 Subject: [PATCH 065/165] Update README.md --- README.md | 55 ++++++++++--------------------------------------------- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 6136c3b..579ddb1 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,10 @@ - - - - -
-

🐍 Python Functions Tutorial and Exercises

-

By @alesanchezr and other contributors at 4Geeks Academy

- - - follow on Twitter - -
- - - - - - - -
-

+ +# 🐍 Python Functions Tutorial and Exercises + +By @alesanchezr and other contributors at 4Geeks Academy + + + Learn and practice Python Functions. You will see the folowing concepts: 1. Declaring a function. @@ -28,42 +17,18 @@ Learn and practice Python Functions. You will see the folowing concepts: 5. Function recursivity, and many other functional concepts. -The entire tutorial is 👆 interactive, ✅ auto-graded and with. 📹 video tutorials. -

-
- -
- - -

📚 Table of contents:

- - - - - - - - - - - - -
1. Python for Beginners
2. Practice Looping Lists and Tuples
3. Practice functions← 🔥 your are here now
4. Master Python (intermediate)
5. Python API Requests
6. What next? Request a new tutorial or collaborate.
We will feature your profile in our list of contributors
+Note: The entire tutorial is 👆 interactive, ✅ auto-graded and with 📹 video tutorials. These exercises were built in collaboration, we need you! If you find any bugs or misspells please contribute and report them. -

+ ## One click installation: -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) - +Click in the following links to open immediately in [Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) or [Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). ## Local Installation From 982566c4008495670979c4fd252fc0514d09e281 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 13 Mar 2023 12:52:44 -0400 Subject: [PATCH 066/165] Update README.es.md --- README.es.md | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/README.es.md b/README.es.md index 4ce42a0..35016e9 100644 --- a/README.es.md +++ b/README.es.md @@ -1,19 +1,9 @@ - - - - -
-

🐍 Turorial y Ejercicios sobre Funciones de Python

-

Por @alesanchezr y otros colaboradores at 4Geeks Academy

- - - follow on Twitter - -
- - - - - -
-

+ +# 🐍 Turorial y Ejercicios sobre Funciones de Python +Creado por @alesanchezr y othors contribuyentes en 4Geeks Academy + + + Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: 1. Declarar una función. @@ -27,15 +17,6 @@ Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: 5. Recursividad de funciones y muchos otros conceptos funcionales. Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. -

-
- -
- - Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error o falta de ortografía, por favor contribuye y repórtalo. @@ -43,9 +24,11 @@ Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error

+ + ## Instalación en un clic: -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git) +Haz clic en los siguientes enlaces para abrir este tutorial inmediatamente en [Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) o [Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). ## Instalación local: From d4d96055f1463c681113b9a9c57cfac28fac87c2 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 13 Mar 2023 12:53:05 -0400 Subject: [PATCH 067/165] Update README.es.md --- README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.es.md b/README.es.md index 35016e9..0eb48fe 100644 --- a/README.es.md +++ b/README.es.md @@ -34,13 +34,13 @@ Haz clic en los siguientes enlaces para abrir este tutorial inmediatamente en [C 1) Asegúrate de instalar [learnpack](https://learnpack.co), `node.js` version 14+ y python version 3+. Este es el comando para instalar learnpack: -``` +```sh $ npm i learnpack -g && learnpack plugins:install learnpack-python ``` 2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás un carpeta nueva con un subdirectorio "exercises" que contiene los ejercicios. -``` +```sh $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git ``` From 46056397e5a28f7ff26ff2ff97611468341c04ae Mon Sep 17 00:00:00 2001 From: Lorenagubaira Date: Tue, 4 Apr 2023 17:08:48 +0000 Subject: [PATCH 068/165] the footnotes were added --- README.es.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.es.md b/README.es.md index 0eb48fe..b273bd8 100644 --- a/README.es.md +++ b/README.es.md @@ -79,3 +79,5 @@ Este proyecto sigue la especificación [all-contributors](https://github.com/ken ¡Todas las contribuciones son bienvenidas! Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! + +Este y otros ejercicios son usados para [aprender a programar](https://4geeksacademy.com/es/aprender-a-programar/aprender-a-programar-desde-cero) por parte de los alumnos de 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) realizado por [Alejandro Sánchez](https://twitter.com/alesanchezr) y muchos otros contribuyentes. Conoce más sobre nuestros [Curso de Programación](https://4geeksacademy.com/es/curso-de-programacion-desde-cero?lang=es) para convertirte en [Full Stack Developer](https://4geeksacademy.com/es/coding-bootcamps/desarrollador-full-stack/?lang=es), o nuestro [Data Science Bootcamp](https://4geeksacademy.com/es/coding-bootcamps/curso-datascience-machine-learning). \ No newline at end of file diff --git a/README.md b/README.md index 579ddb1..cb29157 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,5 @@ Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all- This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome! + +This and many other exercises are built by students as part of the 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) by [Alejandro Sánchez](https://twitter.com/alesanchezr) and many other contributors. Find out more about our [Full Stack Developer Course](https://4geeksacademy.com/us/coding-bootcamps/part-time-full-stack-developer), and [Data Science Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning). From d09a84c0a1b46c786182d4d47d835a97f015e9dd Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Thu, 6 Apr 2023 20:40:09 +0000 Subject: [PATCH 069/165] added sol --- exercises/09-Function-parameters/solution.hide.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 exercises/09-Function-parameters/solution.hide.py diff --git a/exercises/09-Function-parameters/solution.hide.py b/exercises/09-Function-parameters/solution.hide.py new file mode 100644 index 0000000..71e6d5f --- /dev/null +++ b/exercises/09-Function-parameters/solution.hide.py @@ -0,0 +1,7 @@ +# Your code goes here: +def render_person(name, birthdate, eye_color, age, sex): + return name +" is a "+ str(age) +" years old " + sex +" born in " + birthdate + " with "+eye_color +" eyes" + + +# Do not edit below this line +print(render_person('Bob', '05/22/1983', 'green', 23, 'male')) \ No newline at end of file From 07512a040d0dd035d9acaeef1eff2024487fd810 Mon Sep 17 00:00:00 2001 From: lorenagubaira <102861577+Lorenagubaira@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:46:31 +0000 Subject: [PATCH 070/165] codepaces reference --- README.es.md | 12 +++++++----- README.md | 15 +++++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.es.md b/README.es.md index b273bd8..a60e9c6 100644 --- a/README.es.md +++ b/README.es.md @@ -4,6 +4,7 @@ Creado por @alesanchezr y + Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: 1. Declarar una función. @@ -26,9 +27,11 @@ Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error -## Instalación en un clic: +## Instalación en un clic (recomendado) + +Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Codespaces](https://codespaces.new/?repo=4GeeksAcademy/css-layouts-tutorial-exercises) (recomendado) o [Abrir en Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/css-layouts-tutorial-exercises.git). -Haz clic en los siguientes enlaces para abrir este tutorial inmediatamente en [Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) o [Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). +> Una vez ya tengas abierto VSCode, los ejercicios de LearnPack deberían empezar automáticamente; si esto no sucede puedes intentar empezar los ejercicios escribiendo este comando en tu terminal: `$ learnpack start` ## Instalación local: @@ -51,9 +54,6 @@ $ cd python-functions-programming-exercises $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` - -Nota: Estos ejercicios tienen calificación automática pero es un tanto rígida, te recomiendo ignorar los tests, considéralos como una recomendación o podrías frustrarte. - ## ¿Cómo están organizados los ejercicios? @@ -64,6 +64,8 @@ Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes arc 2. **README.md:** contiene las instrucciones del ejercicio. 3. **test.py:** no tienes que abrir este archivo. Contiene los scripts de pruebas del ejercicio. +> Nota: Estos ejercicios tienen calificación automática pero es un tanto rígida, te recomiendo ignorar los tests, considéralos como una recomendación o podrías frustrarte. + ## Colaboradores Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): diff --git a/README.md b/README.md index cb29157..5332d04 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ By @alesanchezr and + +*Estas instrucciones [están disponibles en 🇪🇸 español](https://github.com/Lorenagubaira/python-functions-programming-exercises/blob/master/README.es.md) :es:* + Learn and practice Python Functions. You will see the folowing concepts: 1. Declaring a function. @@ -17,7 +20,7 @@ Learn and practice Python Functions. You will see the folowing concepts: 5. Function recursivity, and many other functional concepts. -Note: The entire tutorial is 👆 interactive, ✅ auto-graded and with 📹 video tutorials. +> Note: The entire tutorial is 👆 interactive, ✅ auto-graded and with 📹 video tutorials. These exercises were built in collaboration, we need you! If you find any bugs or misspells please contribute and report them. @@ -26,9 +29,12 @@ These exercises were built in collaboration, we need you! If you find any bugs o

-## One click installation: -Click in the following links to open immediately in [Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) or [Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). +## One click installation (recommended): + +You can open these exercises in just a few seconds by clicking: [Open in Codespaces](https://codespaces.new/?repo=4GeeksAcademy/css-layouts-tutorial-exercises) (recommended) or [Open in Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/css-layouts-tutorial-exercises.git). + +> Once you have VSCode open the LearnPack exercises should start automatically. If exercises don't run automatically you can try typing on your terminal: `$ learnpack start` ## Local Installation @@ -52,7 +58,6 @@ $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` -Note: The exercises have automatic grading but its very rigid and string, my recomendation is to ignore the tests and use them only as a recomendation or you can get frustrated. ## How are the exercises organized? @@ -63,6 +68,8 @@ Each exercise is a small react application containing the following files: 2. **README.md:** contains exercise instructions. 3. **test.py:** you don't have to open this file, it contains the testing script for the exercise. +> Note: The exercises have automatic grading but its very rigid and string, my recomendation is to ignore the tests and use them only as a recomendation or you can get frustrated. + ## Contributors Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): From 61a98b6d0ed14ed691b97652df02c938a5bc8a7b Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Fri, 14 Apr 2023 20:52:34 -0400 Subject: [PATCH 071/165] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 68ef1fb..e32e2b3 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,28 @@ FROM gitpod/workspace-full:latest + +SHELL ["/bin/bash", "-c"] + +RUN sudo apt-get update \ + && sudo apt-get update \ + && sudo apt-get clean \ + && sudo rm -rf /var/cache/apt/* /var/lib/apt/lists/* /tmp/* + +# That Gitpod install pyenv for me? no, thanks +WORKDIR /home/gitpod/ +RUN rm .pyenv -Rf +RUN rm .gp_pyenv.d -Rf +RUN curl https://pyenv.run | bash + + +RUN pyenv update && pyenv install 3.10.7 && pyenv global 3.10.7 +RUN pip install pipenv + +# remove PIP_USER environment USER gitpod -RUN pip3 install pytest==4.4.2 pytest-testdox mock +RUN if ! grep -q "export PIP_USER=no" "$HOME/.bashrc"; then printf '%s\n' "export PIP_USER=no" >> "$HOME/.bashrc"; fi +RUN echo "" >> $HOME/.bashrc +RUN echo "unset DATABASE_URL" >> $HOME/.bashrc +RUN echo "export DATABASE_URL" >> $HOME/.bashrc + +RUN pip3 install pytest==6.2.5 pytest-testdox mock RUN npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 From f5f0a1d67d6b88523cfc784b0e80c1f03818ba46 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Fri, 14 Apr 2023 21:12:25 -0400 Subject: [PATCH 072/165] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f3ca55f..28bfd34 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /* !.gitignore +!.devcontainer +!.devcontainer/* !.gitpod.yml !.gitpod.Dockerfile !bc.json From 455bfcbfa3e8b2e0b37573f0d2c3aef7c09f0920 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Fri, 14 Apr 2023 21:12:49 -0400 Subject: [PATCH 073/165] Create devcontainer.json --- .devcontainer/devcontainer.json | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3c87dfd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,40 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:0-3.10", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "nodeGypDependencies": true, + "version": "16" + } + }, + "customizations": { + "vscode": { + "settings": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "workbench.editorAssociations": { + "*.md": "vscode.markdown.preview.editor" + } + }, + "extensions": ["learn-pack.learnpack-vscode"] + } + }, + "onCreateCommand": "pip3 install pytest==6.2.5 pytest-testdox mock && npm i @learnpack/learnpack@2.1.20 -g && learnpack plugins:install @learnpack/python@1.0.0" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From d53186f038f9d394e6f3ef816c36988fdd0e5653 Mon Sep 17 00:00:00 2001 From: lorenagubaira <102861577+Lorenagubaira@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:32:45 +0000 Subject: [PATCH 074/165] the links were updated --- README.es.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.es.md b/README.es.md index a60e9c6..ca39bca 100644 --- a/README.es.md +++ b/README.es.md @@ -29,7 +29,7 @@ Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error ## Instalación en un clic (recomendado) -Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Codespaces](https://codespaces.new/?repo=4GeeksAcademy/css-layouts-tutorial-exercises) (recomendado) o [Abrir en Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/css-layouts-tutorial-exercises.git). +Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) (recomendado) o [Abrir en Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). > Una vez ya tengas abierto VSCode, los ejercicios de LearnPack deberían empezar automáticamente; si esto no sucede puedes intentar empezar los ejercicios escribiendo este comando en tu terminal: `$ learnpack start` diff --git a/README.md b/README.md index 5332d04..704c8b8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ These exercises were built in collaboration, we need you! If you find any bugs o ## One click installation (recommended): -You can open these exercises in just a few seconds by clicking: [Open in Codespaces](https://codespaces.new/?repo=4GeeksAcademy/css-layouts-tutorial-exercises) (recommended) or [Open in Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/css-layouts-tutorial-exercises.git). +You can open these exercises in just a few seconds by clicking: [Open in Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) (recommended) or [Open in Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises). > Once you have VSCode open the LearnPack exercises should start automatically. If exercises don't run automatically you can try typing on your terminal: `$ learnpack start` From ade25903a0ca2eb87c664feb72d100ac14cedf5f Mon Sep 17 00:00:00 2001 From: lorenagubaira <102861577+Lorenagubaira@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:04:23 +0000 Subject: [PATCH 075/165] the settings.json file was updated --- .gitignore | 1 + .vscode/settings.json | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 28bfd34..964585a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ !learn.json !README.md !README.*.md +!.vscode !/exercises !/exercises/* diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..2f5ad94 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "files.autoSave": "afterDelay", + "files.autoSaveDelay": 700, + "editor.minimap.enabled": false, + "workbench.editorAssociations": { + "*.md": "vscode.markdown.preview.editor" + } +} \ No newline at end of file From c1680dee8aea088518add282ff4aaadb12ce978f Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:34:59 +0000 Subject: [PATCH 076/165] increased flexibility of test by adding blank space tolerance --- exercises/04-Call-a-function/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04-Call-a-function/tests.py b/exercises/04-Call-a-function/tests.py index cbd4870..52dc7d3 100755 --- a/exercises/04-Call-a-function/tests.py +++ b/exercises/04-Call-a-function/tests.py @@ -48,5 +48,5 @@ def test_call_calculate_area(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"=(\s*)calculate_area\(") + regex = re.compile(r"=(\s*)calculate_area\s*\(") assert bool(regex.search(content)) == True \ No newline at end of file From 2621f89b71a13d0d07ba861661a3809c1b01c91c Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:35:55 +0000 Subject: [PATCH 077/165] added solution file --- exercises/04-Call-a-function/solution.hide.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 exercises/04-Call-a-function/solution.hide.py diff --git a/exercises/04-Call-a-function/solution.hide.py b/exercises/04-Call-a-function/solution.hide.py new file mode 100644 index 0000000..d02eb4a --- /dev/null +++ b/exercises/04-Call-a-function/solution.hide.py @@ -0,0 +1,7 @@ +def calculate_area(length,edge): + return length * edge + +# Your code Below this line: +square_area1 = calculate_area(4,4) +square_area2 = calculate_area(2,2) +square_area3 = calculate_area(5,5) \ No newline at end of file From fe80228644ddb235c760844661d4532ae66489f0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:00:09 +0100 Subject: [PATCH 078/165] Update README.md --- README.md | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 704c8b8..a0ced50 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ By @alesanchezr and - -

+These exercises were built in collaboration, we need you! If you find any bugs or misspellings, please contribute and report them. @@ -34,49 +30,49 @@ These exercises were built in collaboration, we need you! If you find any bugs o You can open these exercises in just a few seconds by clicking: [Open in Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) (recommended) or [Open in Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises). -> Once you have VSCode open the LearnPack exercises should start automatically. If exercises don't run automatically you can try typing on your terminal: `$ learnpack start` +> Once you have VSCode open, the LearnPack exercises should start automatically. If exercises don't run automatically you can try typing on your terminal: `$ learnpack start` ## Local Installation -1) Make sure you have [learnpack](https://learnpack.co) installed, `node.js` version 14+ and python version 3+. This is the command to install learnpack: +1) Make sure you have [LearnPack](https://learnpack.co) installed, node.js version 14+, and Python version 3+. This is the command to install LearnPack: -``` +```bash $ npm i learnpack -g && learnpack plugins:install learnpack-python ``` -2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory "exercises" that contains all the exercises within. +2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. -``` +```bash $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git ``` 3) Start the tutorial/exercises by running the following command from the root of the project: -```sh +```bash $ cd python-functions-programming-exercises $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` - + ## How are the exercises organized? -Each exercise is a small react application containing the following files: +Each exercise is a small React application containing the following files: -1. **app.py:** represents the entry python file that will be executed by the computer. +1. **app.py:** represents the entry Python file that will be executed by the computer. 2. **README.md:** contains exercise instructions. 3. **test.py:** you don't have to open this file, it contains the testing script for the exercise. -> Note: The exercises have automatic grading but its very rigid and string, my recomendation is to ignore the tests and use them only as a recomendation or you can get frustrated. +> Note: The exercises have automatic grading, but it's very rigid and strict, my recommendation is to not take the tests too serious and use them only as a suggestion, or you may get frustrated. ## Contributors Thanks to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻 (idea) 🤔, (build-tests) ⚠️ , (pull-request-review) 👀 (build-tutorial) ✅ (documentation) 📖 +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 👀, (build-tutorial) ✅ (documentation) 📖 -2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) 🐛, contribution: (coder), (translation) 🌎 +2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) 🐛, (coder) 💻, (translation) 🌎 3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) :🐛, (translation) 🌎 From b27c19a1b03bcf7cfc6da90fa1c92af6f1f12a2a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:10:58 +0100 Subject: [PATCH 079/165] Update README.es.md --- README.es.md | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/README.es.md b/README.es.md index ca39bca..1a99e9c 100644 --- a/README.es.md +++ b/README.es.md @@ -1,6 +1,6 @@ -# 🐍 Turorial y Ejercicios sobre Funciones de Python -Creado por @alesanchezr y othors contribuyentes en 4Geeks Academy +# 🐍 Tutorial y Ejercicios sobre Funciones de Python +Creado por @alesanchezr y otros contribuyentes en 4Geeks Academy @@ -13,66 +13,63 @@ Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: 3. Alcances de funciones. -4. Funciones añadidas. +4. Funciones anidadas. 5. Recursividad de funciones y muchos otros conceptos funcionales. -Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con. 📹 videos tutoriales. +Todo el tutorial es 👆 interactivo, ✅ calificado automáticamente y con 📹 video tutoriales. Estos ejercicios son colaborativos, ¡te necesitamos! Si encuentras algún error o falta de ortografía, por favor contribuye y repórtalo. -

- -

- ## Instalación en un clic (recomendado) Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Codespaces](https://codespaces.new/?repo=4GeeksAcademy/python-functions-programming-exercises) (recomendado) o [Abrir en Gitpod](https://gitpod.io#https://github.com/4GeeksAcademy/python-functions-programming-exercises.git). -> Una vez ya tengas abierto VSCode, los ejercicios de LearnPack deberían empezar automáticamente; si esto no sucede puedes intentar empezar los ejercicios escribiendo este comando en tu terminal: `$ learnpack start` +> Una vez ya tengas abierto VSCode, los ejercicios de LearnPack deberían empezar automáticamente; si esto no sucede, puedes intentar empezar los ejercicios escribiendo este comando en tu terminal: `$ learnpack start` ## Instalación local: -1) Asegúrate de instalar [learnpack](https://learnpack.co), `node.js` version 14+ y python version 3+. Este es el comando para instalar learnpack: +1) Asegúrate de instalar [LearnPack](https://learnpack.co), node.js version 14+ y Python version 3+. Este es el comando para instalar LearnPack: -```sh +```bash $ npm i learnpack -g && learnpack plugins:install learnpack-python ``` -2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás un carpeta nueva con un subdirectorio "exercises" que contiene los ejercicios. +2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás una carpeta nueva con un subdirectorio llamado "exercises" que contiene los ejercicios. -```sh +```bash $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git ``` 3) Comienza el tutorial/ejercicios ejecutando el siguiente comando en la raíz del proyecto: -```sh +```bash $ cd python-functions-programming-exercises $ pip install pytest==4.4.2 mock pytest-testdox $ learnpack start ``` + ## ¿Cómo están organizados los ejercicios? Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes archivos: -1. **app.py:** representa el archivo de entrada de python que será ejecutado en el computador. +1. **app.py:** representa el archivo de entrada de Python que será ejecutado en el computador. 2. **README.md:** contiene las instrucciones del ejercicio. -3. **test.py:** no tienes que abrir este archivo. Contiene los scripts de pruebas del ejercicio. +3. **test.py:** no tienes que abrir este archivo, contiene los scripts de pruebas del ejercicio. -> Nota: Estos ejercicios tienen calificación automática pero es un tanto rígida, te recomiendo ignorar los tests, considéralos como una recomendación o podrías frustrarte. +> Nota: Estos ejercicios tienen calificación automática. Los tests son muy rígidos y estrictos, mi recomendación es que no prestes demasiada atención a los tests y los uses solo como una sugerencia o podrías frustrarte. ## Colaboradores Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻 (idea) 🤔, (build-tests) ⚠️ , (pull-request-review) 🤓 (build-tutorial) ✅ (documentación) 📖 +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentación) 📖 -2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (programador), (traducción) 🌎 +2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (programador) 💻, (traducción) 🌎 3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (traducción) 🌎 @@ -82,4 +79,4 @@ Este proyecto sigue la especificación [all-contributors](https://github.com/ken Este proyecto sigue la especificación [all-contributors](https://github.com/kentcdodds/all-contributors). ¡Todas las contribuciones son bienvenidas! -Este y otros ejercicios son usados para [aprender a programar](https://4geeksacademy.com/es/aprender-a-programar/aprender-a-programar-desde-cero) por parte de los alumnos de 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) realizado por [Alejandro Sánchez](https://twitter.com/alesanchezr) y muchos otros contribuyentes. Conoce más sobre nuestros [Curso de Programación](https://4geeksacademy.com/es/curso-de-programacion-desde-cero?lang=es) para convertirte en [Full Stack Developer](https://4geeksacademy.com/es/coding-bootcamps/desarrollador-full-stack/?lang=es), o nuestro [Data Science Bootcamp](https://4geeksacademy.com/es/coding-bootcamps/curso-datascience-machine-learning). \ No newline at end of file +Este y otros ejercicios son usados para [aprender a programar](https://4geeksacademy.com/es/aprender-a-programar/aprender-a-programar-desde-cero) por parte de los alumnos de 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) realizado por [Alejandro Sánchez](https://twitter.com/alesanchezr) y muchos otros contribuyentes. Conoce más sobre nuestros [Cursos de Programación](https://4geeksacademy.com/es/curso-de-programacion-desde-cero?lang=es) para convertirte en [Full Stack Developer](https://4geeksacademy.com/es/coding-bootcamps/desarrollador-full-stack/?lang=es), o nuestro [Data Science Bootcamp](https://4geeksacademy.com/es/coding-bootcamps/curso-datascience-machine-learning). From 25aa0c717d14ff32e1b4e54b411d45245feb5595 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:11:40 +0100 Subject: [PATCH 080/165] Update README.es.md --- README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.es.md b/README.es.md index 1a99e9c..27f2c3e 100644 --- a/README.es.md +++ b/README.es.md @@ -11,7 +11,7 @@ Aprende y practica las funciones de Python. Vas a ver los siguientes conceptos: 2. Llamar a una función. -3. Alcances de funciones. +3. Alcance de una función. 4. Funciones anidadas. From fed4e6f67164dad6e86c4edc3430839831d72686 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:13:18 +0100 Subject: [PATCH 081/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0ced50..1b224b1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ By @alesanchezr and -*Estas instrucciones [están disponibles en 🇪🇸 español](https://github.com/Lorenagubaira/python-functions-programming-exercises/blob/master/README.es.md) :es:* +*Estas instrucciones [están disponibles en 🇪🇸 español](https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/README.es.md) :es:* Learn and practice Python Functions. You will see the following concepts: From 3938ca85be27f5fabf408b8304def472cfc64d38 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:14:19 +0100 Subject: [PATCH 082/165] Update learn.json --- learn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learn.json b/learn.json index 73fe16d..6e17813 100644 --- a/learn.json +++ b/learn.json @@ -7,7 +7,7 @@ "repository": "https://github.com/4GeeksAcademy/python-functions-programming-exercises", "preview": "https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/preview.gif?raw=true", "description": { - "us": "Learn and master functional programing by doing auto-graded interactive exercises.", + "us": "Learn and master functional programming by doing auto-graded interactive exercises.", "es": "Aprende y domina funciones en Python haciendo ejercicios interactivos y auto-evaluados." }, "duration": 10, From 95937fedfbd0c7ee7f556cbcf8417e2a10b7b73c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:38:36 +0100 Subject: [PATCH 083/165] Update README.md --- exercises/01-hello-world/README.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/exercises/01-hello-world/README.md b/exercises/01-hello-world/README.md index c9a83c8..30cf49b 100644 --- a/exercises/01-hello-world/README.md +++ b/exercises/01-hello-world/README.md @@ -2,32 +2,30 @@ intro: "https://www.youtube.com/watch?v=awa_yfGgy9s" --- -# Learn Python Functions! +# Welcome to Python Functions! We are very excited to have you here !! 🎉 😂 -Click `next` on the top right of this instructions when you are ready to start. +Click `next` on the top right of these instructions when you are ready to start. -During this course you will be learning the following concepts: +During this course, you will be learning the following concepts: -1. Learning how to create and call **functions.*** +1. Learning how to create and call functions. -2. Building your first real **functions** +2. Building your first real functions. -3. Get comfortable using Python **Lambda Functions** +3. Get comfortable using Python Lambda Functions. -4. Construct **functions** with parameters. +4. Construct functions with parameters. -5. Real life examples for **functions** +5. Real life examples for functions. ## Contributors Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book: -2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) :bug:, contribution: (coder), (translation) :earth_americas: -3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) :bug:, (translation) :earth_africa: +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻 (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentation) 📖 +2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) 🐛, (coder) 💻, (translation) 🌎 +3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (translation) 🌎 -This project follows the -[all-contributors](https://github.com/kentcdodds/all-contributors) -specification. Contributions of any kind are welcome! +This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome! From d4cd0b8db591e04198b011af93e38651c9f35be2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:02:26 +0100 Subject: [PATCH 084/165] Update README.md --- exercises/01-hello-world/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/01-hello-world/README.md b/exercises/01-hello-world/README.md index 30cf49b..5522b4b 100644 --- a/exercises/01-hello-world/README.md +++ b/exercises/01-hello-world/README.md @@ -6,7 +6,7 @@ intro: "https://www.youtube.com/watch?v=awa_yfGgy9s" We are very excited to have you here !! 🎉 😂 -Click `next` on the top right of these instructions when you are ready to start. +Click `Next →` on the top right of these instructions when you are ready to start. During this course, you will be learning the following concepts: @@ -24,7 +24,7 @@ During this course, you will be learning the following concepts: Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻 (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentation) 📖 +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentation) 📖 2. [Paolo (plucodev)](https://github.com/plucodev), contribution: (bug reports) 🐛, (coder) 💻, (translation) 🌎 3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribution: (bug reports) 🐛, (translation) 🌎 From 86ba89b902166db27cae9e85a57ca0d9eebcb12b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:02:30 +0100 Subject: [PATCH 085/165] Update README.es.md --- exercises/01-hello-world/README.es.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/exercises/01-hello-world/README.es.md b/exercises/01-hello-world/README.es.md index 7f288fa..82f48a5 100644 --- a/exercises/01-hello-world/README.es.md +++ b/exercises/01-hello-world/README.es.md @@ -1,29 +1,27 @@ -# Aprende Funciones en Python! +# Welcome to Python Functions! -¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 +¡¡Nos entusiasma mucho tenerte aquí!! 🎉 😂 Presiona `Next →` en la esquina superior derecha cuando quieras empezar. En este curso aprenderás los siguientes conceptos: -1. Cómo crear y llamar **funciones.** +1. Cómo crear y llamar funciones. -2. Construir tus primeras **funciones.** +2. Construir tus primeras funciones. -3. Sentirte cómod@ usando **funciones Lambda** en Python. +3. Practicar las funciones Lambda de Python. -4. Construir **funciones** con parámetros. +4. Construir funciones con parámetros. -5. Ejemplos de la vida real con **funciones** +5. Ejemplos de la vida real con funciones. ## Contributors Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book: -2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) :bug: (coder) :computer:, (traducción) :earth_americas: -3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (bug reports) :bug:, (traducción) :earth_africa: +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentation) 📖 +2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (coder) 💻, (traducción) 🌎 +3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (bug reports) 🐛, (traducción) 🌎 -This project follows the -[all-contributors](https://github.com/kentcdodds/all-contributors) -specification. Contributions of any kind are welcome! +This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome! From 185c68ca1badabaf2352bbb7033c7df44f57dff4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:12:56 +0100 Subject: [PATCH 086/165] Update README.md --- exercises/02-Hello-World/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/02-Hello-World/README.md b/exercises/02-Hello-World/README.md index 99bb08f..826f3ac 100644 --- a/exercises/02-Hello-World/README.md +++ b/exercises/02-Hello-World/README.md @@ -4,22 +4,22 @@ tutorial: "https://www.youtube.com/watch?v=voBO7a0KPtE" # `02` Hello World -In Python, we use `print` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called `the console`. +In Python, we use `print` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console". -Every language has **functions** to integrate with the console, as it was the only way to interact with the users at the beginning (before the Windows or Linux or MacOS arrived). +Every language has **functions** to integrate with the console, as it was the only way to interact with the users at the beginning (before Windows, Linux or macOS arrived). -Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. +Today, printing in the console is mostly used as a monitoring and debugging tool, ideal for leaving a trace of the content of variables during the program's execution. This is an example of how to use it: + ```py print("How are you?") ``` ## 📝 Instructions: -1. Use `print` to display `"Hello World"` on the console. Feel free to try other things as well. +1. Use `print()` to display `"Hello World"` on the console. Feel free to try other things as well. ## 💡 Hint: -+ :video_camera: You can watch this 5 minutes video about the console: -https://www.youtube.com/watch?v=vROGBvX_MHQ ++ 📹 You can watch this 2 minute video about the console: https://www.youtube.com/watch?v=vROGBvX_MHQ From 849627ea920fcf13f7916e67be6e23fe8db7e93d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:14:19 +0100 Subject: [PATCH 087/165] Update README.md --- exercises/02-Hello-World/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/README.md b/exercises/02-Hello-World/README.md index 826f3ac..25b59bc 100644 --- a/exercises/02-Hello-World/README.md +++ b/exercises/02-Hello-World/README.md @@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=voBO7a0KPtE" # `02` Hello World -In Python, we use `print` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console". +In Python, we use **print** to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console". Every language has **functions** to integrate with the console, as it was the only way to interact with the users at the beginning (before Windows, Linux or macOS arrived). From c8d874ba716f90c16b4348818bf5cb3404f4775a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:17:58 +0100 Subject: [PATCH 088/165] Update README.es.md --- exercises/02-Hello-World/README.es.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index 0e91c64..c27cad8 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -1,10 +1,12 @@ # `02` Hello World -En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) en algo llamado `la consola`. +En Python, usamos **print** para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un string dado, etc.) en algo llamado "la consola". -Cada idioma tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). Hoy en día, la impresión en la consola se utiliza (`print`) sobre todo como herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. +Cada lenguaje tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegaran Windows, Linux o macOS) -Este es un ejemplo de cómo usarlo +Hoy en día, la impresión en la consola se utiliza, sobre todo, como herramienta de monitoreo y depuración, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. + +Este es un ejemplo de cómo usarla: ```py print("How are you?") @@ -16,5 +18,4 @@ print("How are you?") ## 💡 Pista: -+ :video_camera: Puedes ver este breve video (5 minutos) sobre la consola: -https://www.youtube.com/watch?v=vROGBvX_MHQ ++ 📹 Puedes ver este breve video (2 minutos) sobre la consola: https://www.youtube.com/watch?v=vROGBvX_MHQ From fc6cc2cfc9cf9d9dcd78fd4310bbadd977e181eb Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:18:22 +0100 Subject: [PATCH 089/165] Update README.es.md --- exercises/02-Hello-World/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/README.es.md b/exercises/02-Hello-World/README.es.md index c27cad8..2ebad83 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/02-Hello-World/README.es.md @@ -2,7 +2,7 @@ En Python, usamos **print** para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un string dado, etc.) en algo llamado "la consola". -Cada lenguaje tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegaran Windows, Linux o macOS) +Cada lenguaje tiene **funciones** para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegaran Windows, Linux o macOS). Hoy en día, la impresión en la consola se utiliza, sobre todo, como herramienta de monitoreo y depuración, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. From bc3b37086a48cda33fc66c5a46600dd7a0489108 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:18:37 +0100 Subject: [PATCH 090/165] Update app.py --- exercises/02-Hello-World/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/app.py b/exercises/02-Hello-World/app.py index 801de24..fce62c1 100644 --- a/exercises/02-Hello-World/app.py +++ b/exercises/02-Hello-World/app.py @@ -1 +1 @@ -# your code here \ No newline at end of file +# Your code here From ea6a0e2b6548519be2d7e655c7ebb8ee83a73d78 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:19:47 +0100 Subject: [PATCH 091/165] Create solution.hide.py --- exercises/02-Hello-World/solution.hide.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 exercises/02-Hello-World/solution.hide.py diff --git a/exercises/02-Hello-World/solution.hide.py b/exercises/02-Hello-World/solution.hide.py new file mode 100644 index 0000000..84d3ce7 --- /dev/null +++ b/exercises/02-Hello-World/solution.hide.py @@ -0,0 +1,3 @@ +# Your code here + +print("Hello World!") From d893571d2a66b03c879a62931cf7b2e35894c4ea Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:19:58 +0100 Subject: [PATCH 092/165] Update solution.hide.py --- exercises/02-Hello-World/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02-Hello-World/solution.hide.py b/exercises/02-Hello-World/solution.hide.py index 84d3ce7..a033754 100644 --- a/exercises/02-Hello-World/solution.hide.py +++ b/exercises/02-Hello-World/solution.hide.py @@ -1,3 +1,3 @@ # Your code here -print("Hello World!") +print("Hello World") From 16d9038149e6071d897352b116c01f6efc5260da Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:27:14 +0100 Subject: [PATCH 093/165] Update README.md --- exercises/03-What-is-a-function/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/03-What-is-a-function/README.md b/exercises/03-What-is-a-function/README.md index 7f2a283..6d3dab9 100755 --- a/exercises/03-What-is-a-function/README.md +++ b/exercises/03-What-is-a-function/README.md @@ -10,19 +10,19 @@ For example: If we want to get the sum of two numbers, we can declare a function ```python def sum(number1,number2): - return number1 + number2 + return number1 + number2 ``` -After the function is declared we can use it as many times as we want, like this: +After the function is declared, we can use it as many times as we want, like this: ```python total = sum(2,3) total2 = sum(5,10) -print(total) # prints 5 on the console -print(total2) # prints 15 on the console +print(total) # Prints 5 on the console +print(total2) # Prints 15 on the console ``` -# 📝 Instructions +## 📝 Instructions: -1. Please calculate the sum between **3445324** and **53454423** and assign the result to a variable called `super_duper` +1. Please calculate the sum between `3445324` and `53454423` and assign the result to a variable called `super_duper` From 1a1fec3cbc33079eac311fc7120bb6b8777fd3a7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:29:04 +0100 Subject: [PATCH 094/165] Update README.md --- exercises/03-What-is-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/03-What-is-a-function/README.md b/exercises/03-What-is-a-function/README.md index 6d3dab9..4f00844 100755 --- a/exercises/03-What-is-a-function/README.md +++ b/exercises/03-What-is-a-function/README.md @@ -25,4 +25,4 @@ print(total2) # Prints 15 on the console ## 📝 Instructions: -1. Please calculate the sum between `3445324` and `53454423` and assign the result to a variable called `super_duper` +1. Please calculate the sum between `3445324` and `53454423` and assign the result to a variable called `super_duper`. From 3d4a1141f42e37d28f53af10aaa6072879984dfc Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:29:23 +0100 Subject: [PATCH 095/165] Update README.es.md --- exercises/03-What-is-a-function/README.es.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/03-What-is-a-function/README.es.md b/exercises/03-What-is-a-function/README.es.md index 93e8ee9..e1de4ff 100644 --- a/exercises/03-What-is-a-function/README.es.md +++ b/exercises/03-What-is-a-function/README.es.md @@ -1,12 +1,12 @@ -# `03` ¿Qué es una función (function)? +# `03` What is a function? -Puedes ver una función como un **fragmento de código** que puedes encapsular entre llaves para poder usarla varias veces. +Puedes ver una función como un **fragmento de código** que puedes usar varias veces. Por ejemplo, si queremos obtener la suma de dos números, podemos declarar una función llamada `sum` que devuelve la suma de `number1` y `number2`: ```python def sum(number1,number2): - return number1 + number2 + return number1 + number2 ``` Después de declarar la función, podemos usarla tantas veces como queramos, así: @@ -15,10 +15,10 @@ Después de declarar la función, podemos usarla tantas veces como queramos, as total = sum(2,3) total2 = sum(5,10) -print(total) # imprime 5 en la consola -print(total2) # imprime 15 en la consola +print(total) # Imprime 5 en la consola +print(total2) # Imprime 15 en la consola ``` -# 📝 Instrucciones +## 📝 Instrucciones: -1. Calcula la suma entre **3445324** y **53454423** y asigna el resultado a una variable llamada `super_duper` +1. Calcula la suma entre `3445324` y `53454423` y asigna el resultado a una variable llamada `super_duper`. From 1684f5886515adc5c82a26ead61cd47a374e7cfe Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:34:16 +0100 Subject: [PATCH 096/165] Create solution.hide.py --- exercises/03-What-is-a-function/solution.hide.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 exercises/03-What-is-a-function/solution.hide.py diff --git a/exercises/03-What-is-a-function/solution.hide.py b/exercises/03-What-is-a-function/solution.hide.py new file mode 100644 index 0000000..a313431 --- /dev/null +++ b/exercises/03-What-is-a-function/solution.hide.py @@ -0,0 +1,6 @@ +def sum(number1,number2): + return number1 + number2 + +# Your code here +super_duper = sum(3445324,53454423) +print(super_duper) From 6040cfdb03544595cd2cf002e3d0e163a573319e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:34:22 +0100 Subject: [PATCH 097/165] Update app.py --- exercises/03-What-is-a-function/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/03-What-is-a-function/app.py b/exercises/03-What-is-a-function/app.py index daa9ff3..efeec63 100755 --- a/exercises/03-What-is-a-function/app.py +++ b/exercises/03-What-is-a-function/app.py @@ -1,5 +1,6 @@ def sum(number1,number2): return number1 + number2 +# Your code here total = sum(2,3) print(total) From c0891c6b5a8e7371663f7143a485990197fcee02 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:46:52 +0100 Subject: [PATCH 098/165] Update README.md --- exercises/04-Call-a-function/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index f26383c..f8ecbed 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -2,47 +2,47 @@ tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" --- -# `04` Calling a function +# `04` Calling a Function A function could receive zero parameters, and it always returns something, even if you don't explicitly add the `return` statement. -:point_up: [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python) +👉 [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python) For example: a function that calculates the area of a square will be something like this: ```python -def calculate_area(length, edge): - return length * edge +def calculate_area(length, width): + return length * width ``` If you want to use that function to calculate the area of a square with: ```python length = 3 -edge = 6 +width = 6 ``` You need to do something like this: ```python area = calculate_area(3,6) -# The value of area will be set to 18 +# The value of 'area' will be set to 18 ``` ## 📝 Instructions: -1. Create a new variables named `square_area1`, `square_area2`, `square_area3` and call the function `calculate_area` three times one for each square in the picture, for example: +1. Create new variables named `square_area1`, `square_area2`, `square_area3` and call the function `calculate_area` three times, one for each square in the picture, for example: ```python # For the first figure: square_area1 = calculate_area(4,4) ``` -![img](http://i.imgur.com/VyoJRAL.png) +![squares](http://i.imgur.com/VyoJRAL.png) -## 💡 Hint: +## 💡 Hints: + Call the `calculate_area` function three times, one per each square, passing the length and edge of each square. -+ :video_camera: [9 min video about functions in python](https://www.youtube.com/watch?v=NE97ylAnrz4) ++ 📹 [9 min video about functions in Python](https://www.youtube.com/watch?v=NE97ylAnrz4). From c822158e738d2f33464f3dadd2cc1891b9d3c3cb Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:49:24 +0100 Subject: [PATCH 099/165] Update README.md --- exercises/04-Call-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index f8ecbed..655e98d 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" A function could receive zero parameters, and it always returns something, even if you don't explicitly add the `return` statement. -👉 [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python) +👉 [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python). For example: a function that calculates the area of a square will be something like this: From 42fffeedd371fd65a8f558a2d4b164fbc9612605 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:49:58 +0100 Subject: [PATCH 100/165] Update README.md --- exercises/04-Call-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index 655e98d..a0a8bee 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" A function could receive zero parameters, and it always returns something, even if you don't explicitly add the `return` statement. -👉 [Click here to read more about functions](https://content.breatheco.de/lesson/working-with-functions-python). +👉 [Click here to read more about functions](https://4geeks.com/lesson/working-with-functions-python). For example: a function that calculates the area of a square will be something like this: From 2da7f65dd185a0476d985e5aa31ce70d3e8dee6e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:51:46 +0100 Subject: [PATCH 101/165] Update README.md --- exercises/04-Call-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04-Call-a-function/README.md b/exercises/04-Call-a-function/README.md index a0a8bee..58e957f 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/04-Call-a-function/README.md @@ -38,7 +38,7 @@ area = calculate_area(3,6) square_area1 = calculate_area(4,4) ``` -![squares](http://i.imgur.com/VyoJRAL.png) +![Squares](http://i.imgur.com/VyoJRAL.png) ## 💡 Hints: From 772e9e5ab91c2b630b007869aa3b826b2eb5e437 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:53:20 +0100 Subject: [PATCH 102/165] Update README.es.md --- exercises/04-Call-a-function/README.es.md | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/exercises/04-Call-a-function/README.es.md b/exercises/04-Call-a-function/README.es.md index e04cd13..ae2c760 100644 --- a/exercises/04-Call-a-function/README.es.md +++ b/exercises/04-Call-a-function/README.es.md @@ -1,46 +1,46 @@ --- tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" --- -# `04` Llamando a una función +# `04` Calling a Function -Una función podría recibir 0 parámetros y tú puedes devolver algo siempre, incluso si no añades explícitamente el `return`. +Una función podría recibir 0 parámetros y devolverá algo siempre, incluso si no añades explícitamente el `return`. -:point_up: [Presiona aquí para saber más sobre funciones](https://content.breatheco.de/es/lesson/working-with-functions-python/) +👉 [Clic aquí para saber más sobre funciones](https://4geeks.com/es/lesson/working-with-functions-python-es). Por ejemplo, una función que calcula el área de un cuadrado sería algo como esto: ```python -def calculate_area(length, edge): - return length * edge +def calculate_area(length, width): + return length * width ``` -Si deseas usar esa función para calcular el área de un cuadrado con +Si deseas usar esa función para calcular el área de un cuadrado con: ```python length = 3 -edge = 6 +width = 6 ``` Tendrías que hacer algo como esto: ```python area = calculate_area(3,6) -# El valor del área es 18 +# El valor de 'area' sería 18 ``` ## 📝 Instrucciones: -1. Crea nuevas variables llamadas `squareArea1`, `square_area2`, `square_area3` y llama a la función `CalculateArea` 3 veces, un por cada cuadrado en la foto, utilizando las dimensiones de la figura, por ejemplo: +1. Crea nuevas variables llamadas `square_area1`, `square_area2`, `square_area3` y llama a la función `calculate_area` 3 veces, una por cada cuadrado en la foto, utilizando las dimensiones de la figura, por ejemplo: ```python -# para la primera figura: +# Para la primera figura: square_area1 = calculate_area(4,4) ``` -![img](http://i.imgur.com/VyoJRAL.png) +![Cuadrados](http://i.imgur.com/VyoJRAL.png) -## 💡 Pista: +## 💡 Pistas: -- Llama 3 veces a la función `calculate_area`, una por cada cuadrado, pasando la longitud y el borde de cada cuadrado. +- Llama 3 veces a la función `calculate_area`, una por cada cuadrado, pasando la longitud y el ancho de cada cuadrado. -+ :video_camera: [Video de 9 min sobre funciones en Python](https://www.youtube.com/watch?v=NE97ylAnrz4) ++ 📹 [Video de 9 min sobre funciones en Python](https://www.youtube.com/watch?v=NE97ylAnrz4). From 0b953a04cf4bf6d638b0fca22cdce03e4c1ace00 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:54:11 +0100 Subject: [PATCH 103/165] Update app.py --- exercises/04-Call-a-function/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/04-Call-a-function/app.py b/exercises/04-Call-a-function/app.py index c856d48..0c131b3 100755 --- a/exercises/04-Call-a-function/app.py +++ b/exercises/04-Call-a-function/app.py @@ -1,4 +1,4 @@ -def calculate_area(length,edge): - return length * edge +def calculate_area(length, width): + return length * width -# Your code Below this line: \ No newline at end of file +# Your code below this line From 9a62da1023f42a9c460cbec66ec6d3f0fa7cdda5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:54:28 +0100 Subject: [PATCH 104/165] Update solution.hide.py --- exercises/04-Call-a-function/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04-Call-a-function/solution.hide.py b/exercises/04-Call-a-function/solution.hide.py index d02eb4a..758b6e6 100644 --- a/exercises/04-Call-a-function/solution.hide.py +++ b/exercises/04-Call-a-function/solution.hide.py @@ -1,7 +1,7 @@ -def calculate_area(length,edge): - return length * edge +def calculate_area(length, width): + return length * width -# Your code Below this line: +# Your code below this line square_area1 = calculate_area(4,4) square_area2 = calculate_area(2,2) -square_area3 = calculate_area(5,5) \ No newline at end of file +square_area3 = calculate_area(5,5) From bc85b6558f504e99919af2b7e41d44a3e7ce74e4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:57:12 +0100 Subject: [PATCH 105/165] Update tests.py --- exercises/04-Call-a-function/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04-Call-a-function/tests.py b/exercises/04-Call-a-function/tests.py index 52dc7d3..3657291 100755 --- a/exercises/04-Call-a-function/tests.py +++ b/exercises/04-Call-a-function/tests.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Create a function 'calculate_area'") +@pytest.mark.it("Create the function 'calculate_area'") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -16,7 +16,7 @@ def test_for_callable(capsys, app): def test_for_integer(capsys, app): assert isinstance(app.calculate_area(3,4), int) -@pytest.mark.it('We tried the function sum with a=3 and b=4 and it did not return 7') +@pytest.mark.it('We tried the function sum with length=3 and width=4 and it did not return 12') def test_for_return(capsys, app): assert app.calculate_area(3,4) == 12 assert app.calculate_area(5,4) == 20 @@ -43,10 +43,10 @@ def test_for_square_area_value2(capsys, app): def test_for_square_area_value3(capsys, app): assert app.square_area3 == 25 -@pytest.mark.it("Create a function calculate_area must be called 3 times, one for each figure") +@pytest.mark.it("The function calculate_area must be called 3 times, one for each square") def test_call_calculate_area(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() regex = re.compile(r"=(\s*)calculate_area\s*\(") - assert bool(regex.search(content)) == True \ No newline at end of file + assert bool(regex.search(content)) == True From 221f1d2dbc9f69490754f3b2e665d3721077ef6c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:31:42 +0100 Subject: [PATCH 106/165] Update README.md --- .../README.md | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index 3a826e3..ae69c15 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -4,48 +4,38 @@ tutorial: "https://www.youtube.com/watch?v=fz4ttmwZWuc" # `05` Defining vs Calling a function -Functions will only exists if you or somebody else defines them... it is the only way the language compiler/interpreter knows they exist, therefore it's able to run them when you call them. +Functions will only exist if you or somebody else defines them; it is the only way the language compiler/interpreter knows they exist, therefore it's able to run them when you call them. -To define a function we need to write this basic code formula: +To define a function, we need to write this basic code formula: ```python -def myFunctionName(parameter, parameter2, ...parameterX): - # the function code here +def my_function_name(parameter1, parameter2, ...parameterX): + # The function code here return something ``` The word `def` is a reserved word in Python, this means it is only used to define a function. -**The name** of the function could be anything you like. -Tip: use a descriptive name (don't be cheap with words, -use as many as you need) this way you will understand what the function -does -and returns-. -Example names: add_two_integers , calculate_taxes , get_random_number, etc. +**The name** of the function could be anything you like. Tip: Use a descriptive name (don't be cheap with words, use as many as you need); this way, you will understand what the function does -and returns-. -**Parameters:** you can define as many parameters as you like or need. -The amount of parameters will depend on the operations done inside the function, -I.E: if the function is adding two integers `(3 + 4)` this means the function -will need two parameters (one for each integer). +Example names: `add_two_integers`, `calculate_taxes`, `get_random_number`, etc. -**Scope:** All the code that the function will contain need to be indented - one tab to the right, anything on a different indentation -won't be considered as part of the function, -this is called **the scope**, and it could be local (inside the function) -and global (outside of the function). +**Parameters:** You can define as many parameters as you like or need. The amount of parameters will depend on the operations done inside the function. I.E: If the function is adding two integers `(a + b)` this means the function will need two parameters (one for each integer). -**The Return**: not every function needs to return something, but it is recommended that it does. -Tip: returning `None` is a good default for when you, still, don't know if you need to return something. +**Scope:** All the code that the function will contain needs to be indented one tab to the right, anything on a different indentation won't be considered as part of the function. This is called **the scope**, and it could be local (inside the function) and global (outside the function). + +**The Return**: not every function needs to return something, but it is recommended that it does. Tip: returning `None` is a good default for when you still don't know if you need to return something. Example of a function: ```python def concatenate_number_to_string(local_number, local_string): - local_variable = local_string+""+str(local_number) + local_variable = local_string + str(local_number) return local_variable ``` -# 📝 Instructions: +## 📝 Instructions: 1. Define a function called `multi`. @@ -53,6 +43,6 @@ def concatenate_number_to_string(local_number, local_string): 3. Return the result of the multiplication between them. -## 💡 Hint +## 💡 Hint: + Remember to add the `return` line. Every function should return something, in this case it should be the result of the multiplication. From ddff8b17f44858f310477c9719744007d375175e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:32:11 +0100 Subject: [PATCH 107/165] Update README.md --- exercises/05-Defining-vs-Calling-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index ae69c15..4d8287d 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -45,4 +45,4 @@ def concatenate_number_to_string(local_number, local_string): ## 💡 Hint: -+ Remember to add the `return` line. Every function should return something, in this case it should be the result of the multiplication. ++ Remember to add the `return` line. Every function should return something, in this case, it should be the result of the multiplication. From 1ab3115c68aeff5b97f52045d17bbdb333748c9f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:32:23 +0100 Subject: [PATCH 108/165] Update README.md --- exercises/05-Defining-vs-Calling-a-function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/05-Defining-vs-Calling-a-function/README.md index 4d8287d..4d059b5 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=fz4ttmwZWuc" --- -# `05` Defining vs Calling a function +# `05` Defining vs Calling a Function Functions will only exist if you or somebody else defines them; it is the only way the language compiler/interpreter knows they exist, therefore it's able to run them when you call them. From 6310ba496149e5f99ec5344ed436af29445d03e0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:38:58 +0100 Subject: [PATCH 109/165] Update README.es.md --- .../README.es.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/README.es.md b/exercises/05-Defining-vs-Calling-a-function/README.es.md index d193398..0df4059 100644 --- a/exercises/05-Defining-vs-Calling-a-function/README.es.md +++ b/exercises/05-Defining-vs-Calling-a-function/README.es.md @@ -1,13 +1,13 @@ -# `05` Definir vs llamar a una función +# `05` Defining vs Calling a Function -Las funciones solo existen si tú u otra persona las define... es la única forma en que el compilador/intérprete de idiomas sabe que existen, por lo tanto, puede ejecutarlas cuando las llama. +Las funciones solo existen si tú u otra persona las define... es la única forma en que el compilador/intérprete de lenguaje sabe que existen, por lo tanto, puede ejecutarlas cuando las llamas. Para definir una función necesitamos escribir esta fórmula básica de código: ```python -def myFunctionName(parameter, parameter2, ...parameterX): - # codigo de la función aquí - return something +def nombre_de_funcion(parametro1, parametro2, ...parametroX): + # Código de la función aquí + return algo ``` La palabra `def` es una palabra reservada en Python, esto significa que solo se usa para definir una función. @@ -16,13 +16,11 @@ La palabra `def` es una palabra reservada en Python, esto significa que solo se *Consejo:* usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función (y lo que devuelve). -Nombres de ejemplo: `add_two_integers` (suma dos números enteros), `calculate_taxes` (calcular impuestos) , `get_random_number` (obtener número aleatorio), etc. +Nombres de ejemplo: `add_two_integers` (suma dos números enteros), `calculate_taxes` (calcular impuestos), `get_random_number` (obtener número aleatorio), etc. -**Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. +**Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. La cantidad de parámetros dependerá de las operaciones realizadas dentro de la función. -La cantidad de parámetros dependerá de las operaciones realizadas dentro de la función. - -Ejemplo: si la función está sumando dos enteros (3 + 4), esto significa que la función necesitará dos parámetros (uno para cada entero). +Ejemplo: si la función está sumando dos enteros (a + b), esto significa que la función necesitará dos parámetros (uno para cada entero). **Alcance:** Todo el código que contenga la función debe tener una sangría a la derecha, todo lo que esté en una sangría diferente no será considerado como parte de la función, a esto se llama **alcance**, y puede ser local (dentro de la función) y global (fuera de la función). @@ -34,7 +32,7 @@ Ejemplo de una función: ```python def concatenate_number_to_string(local_number, local_string): - local_variable = local_string+""+str(local_number) + local_variable = local_string + str(local_number) return local_variable ``` From 7e81a0ac3fc78e8066fdb9075372527df765a515 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:39:34 +0100 Subject: [PATCH 110/165] Update app.py --- exercises/05-Defining-vs-Calling-a-function/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/app.py b/exercises/05-Defining-vs-Calling-a-function/app.py index 79b86d8..eedeae6 100755 --- a/exercises/05-Defining-vs-Calling-a-function/app.py +++ b/exercises/05-Defining-vs-Calling-a-function/app.py @@ -1,5 +1,5 @@ -# Define the function called "multi" that expects 2 parameters: +# Define below the function called "multi" that expects 2 parameters -# don't edit anything below this line +# Don't edit anything below this line return_value = multi(7,53812212) -print(return_value) \ No newline at end of file +print(return_value) From 473ab8f8b838709b30cca9a80c930d34759f2a72 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:40:39 +0100 Subject: [PATCH 111/165] Update solution.hide.py --- .../05-Defining-vs-Calling-a-function/solution.hide.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py index 6a28c77..afa0209 100644 --- a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py +++ b/exercises/05-Defining-vs-Calling-a-function/solution.hide.py @@ -1,9 +1,7 @@ -# Define the function called "multi" that expects 2 parameters: -def multi(num1 , num2): +# Define below the function called "multi" that expects 2 parameters +def multi(num1, num2): total = num1 * num2 return total - - -# don't edit anything below this line +# Don't edit anything below this line return_value = multi(7,53812212) -print(return_value) \ No newline at end of file +print(return_value) From 8bfb20273373895ed48f5d04ef29377f7ced1902 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:41:23 +0100 Subject: [PATCH 112/165] Update tests.py --- exercises/05-Defining-vs-Calling-a-function/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/05-Defining-vs-Calling-a-function/tests.py b/exercises/05-Defining-vs-Calling-a-function/tests.py index 35f9e6c..ab63ea7 100755 --- a/exercises/05-Defining-vs-Calling-a-function/tests.py +++ b/exercises/05-Defining-vs-Calling-a-function/tests.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Create a function 'multi'") +@pytest.mark.it("Create the function 'multi'") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -20,6 +20,6 @@ def test_for_return_something(capsys, app): def test_for_integer(capsys, app): assert app.multi(3,4) == 12 -@pytest.mark.it('The function multi must receive two numbers and return their multiplication. Testing with different values.') +@pytest.mark.it('The function multi must receive two numbers and return their multiplication. Testing with different values') def test_for_function_return(capsys, app): - assert app.multi(10, 6) == 60 \ No newline at end of file + assert app.multi(10, 6) == 60 From e20ebf2279940cba34be7b8e0f557ed020d17b10 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 28 Nov 2023 08:46:04 -0400 Subject: [PATCH 113/165] Added intro video --- learn.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/learn.json b/learn.json index 73fe16d..4786842 100644 --- a/learn.json +++ b/learn.json @@ -1,4 +1,5 @@ { + "intro": "https://youtu.be/GjQEotj3t6Y?si=cVWLDw5H_FcdOrIY", "title": { "us": "Learn Python Functions Interactively", "es": "Aprende las funciones de Python Interactivamente" @@ -7,7 +8,7 @@ "repository": "https://github.com/4GeeksAcademy/python-functions-programming-exercises", "preview": "https://github.com/4GeeksAcademy/python-functions-programming-exercises/blob/master/preview.gif?raw=true", "description": { - "us": "Learn and master functional programing by doing auto-graded interactive exercises.", + "us": "Learn and master functional programming by doing auto-graded interactive exercises.", "es": "Aprende y domina funciones en Python haciendo ejercicios interactivos y auto-evaluados." }, "duration": 10, From b3fbd36b343c04f7c76e48fd09e7ad4ee83b8bc9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:49:37 +0100 Subject: [PATCH 114/165] Update README.es.md --- exercises/06-lambda-functions/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/06-lambda-functions/README.es.md index a12cdf6..fa629e3 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/06-lambda-functions/README.es.md @@ -5,15 +5,15 @@ Una **función lambda** es una función con solo una línea de código y sin nom Es un tipo de función muy especial en el mundo Python porque puedes usarla como una 'pequeña utilidad' para una programación muy ágil: ```python -# declarando una función normal para una multiplicación +# Declarando una función normal para una multiplicación def multiply(p1, p2): return p1 * p2 -# declarándola en una línea como una función lambda +# Declarándola en una línea como una función lambda multiply = lambda p1,p2: p1 * p2 ``` -1. Las **funciones lambda** tiene que ser siempre muy pequeñas. +1. Las **funciones lambda** tienen que ser siempre muy pequeñas. 2. Las **funciones lambda** pueden tener únicamente una línea. @@ -26,14 +26,14 @@ multiply = lambda p1,p2: p1 * p2 1. Crea una variable llamada `is_odd`. -2. Asígnale una función lambda que devuelva `True` o `False` dependiendo de si un número dado es impar o no. +2. Asígnale una función **lambda** que devuelva `True` o `False` dependiendo de si un número dado es impar o no. ## 💡 Pista: + Así es como declararías una función normal: ```python -# Esta función retorna `True` si el número es impar +# Esta función retorna "True" si el número es impar def is_odd(num): return (num % 2) != 0 ``` From a96cd3548897a2042639c9cdde5444dd9a8aba22 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:50:45 +0100 Subject: [PATCH 115/165] Update README.es.md --- exercises/06-lambda-functions/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/06-lambda-functions/README.es.md index fa629e3..97b1343 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/06-lambda-functions/README.es.md @@ -1,4 +1,4 @@ -# `06` Funciones Lambda en Python +# `06` Lambda Functions in Python Una **función lambda** es una función con solo una línea de código y sin nombre. From 117bc32069eb067cc1c4b28517ddd93ed723af48 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:56:20 +0100 Subject: [PATCH 116/165] Update README.md --- exercises/06-lambda-functions/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index dd38458..202169f 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -3,29 +3,29 @@ tutorial: "https://www.youtube.com/watch?v=HACQ9uerCuE" --- -# `06` Lambda functions in Python +# `06` Lambda Functions in Python A **lambda function** is a function with just one line of code and no name. -It is a very special type of funcion in the world of python because you can use it as a small utility for very agile coding: +It is a very special type of function in the world of Python because you can use it as a small utility for very agile coding: ```python -# declaring a normal funcion for multiplication +# Declaring a normal function for multiplication def multiply(p1, p2): return p1 * p2 -# declaring it now like a one line lambda +# Declaring it now like a one line lambda function multiply = lambda p1,p2: p1 * p2 ``` -:point_uo:Facts: +👉 Facts: -+ **Lambda fuctions** have to be always very small. ++ **Lambda functions** have to always be very small. -+ **Lambda function** can only have one line. ++ **Lambda functions** can only have one line. -+ **Lambda function** doesn't need a `return` statement (it is assumed that it will return whatever is on that one line). ++ **Lambda functions** don't need a `return` statement (it is assumed that it will return whatever is on that one line). -+ **Lambda functions** can be stored in variables or passed as parameters to another function ++ **Lambda functions** can be stored in variables or passed as parameters to another function. ## 📝 Instructions: @@ -33,12 +33,12 @@ multiply = lambda p1,p2: p1 * p2 2. Assign a **lambda function** to it that returns `True` or `False` if a given number is odd. -## 💡Hint +## 💡 Hint + Here is how you would declare it like a normal function: ```py -# this function return True if a number is odd. +# This function returns True if a number is odd. def is_odd(num): return num % 2 != 0 ``` From b8b422f36ff51612dd2a3ca976630e5b280a64a2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:56:41 +0100 Subject: [PATCH 117/165] Update README.md --- exercises/06-lambda-functions/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 202169f..49de6bc 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -17,6 +17,7 @@ def multiply(p1, p2): # Declaring it now like a one line lambda function multiply = lambda p1,p2: p1 * p2 ``` + 👉 Facts: + **Lambda functions** have to always be very small. @@ -38,7 +39,7 @@ multiply = lambda p1,p2: p1 * p2 + Here is how you would declare it like a normal function: ```py -# This function returns True if a number is odd. +# This function returns True if a number is odd def is_odd(num): return num % 2 != 0 ``` From e1d8fe2b1bc5e6778af6ed68dd0251b631aafe6a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:57:32 +0100 Subject: [PATCH 118/165] Update README.es.md --- exercises/06-lambda-functions/README.es.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/06-lambda-functions/README.es.md index 97b1343..40dcd34 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/06-lambda-functions/README.es.md @@ -2,7 +2,7 @@ Una **función lambda** es una función con solo una línea de código y sin nombre. -Es un tipo de función muy especial en el mundo Python porque puedes usarla como una 'pequeña utilidad' para una programación muy ágil: +Es un tipo de función muy especial en el mundo Python porque puedes usarla como una pequeña utilidad para una programación muy ágil: ```python # Declarando una función normal para una multiplicación @@ -13,13 +13,15 @@ def multiply(p1, p2): multiply = lambda p1,p2: p1 * p2 ``` -1. Las **funciones lambda** tienen que ser siempre muy pequeñas. +### 👉 Caracteristicas: -2. Las **funciones lambda** pueden tener únicamente una línea. ++ Las **funciones lambda** tienen que ser siempre muy pequeñas. -3. Las **funciones lambda** no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor. ++ Las **funciones lambda** pueden tener únicamente una línea. -4. Las **funciones lambda** pueden almacenarse en variables o ser pasadas como parámetro a otra función. ++ Las **funciones lambda** no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor. + ++ Las **funciones lambda** pueden almacenarse en variables o ser pasadas como parámetro a otra función. ## 📝 Instrucciones: From 4ed891992ac1299006f3d15e0f1cac964769766a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:57:39 +0100 Subject: [PATCH 119/165] Update README.md --- exercises/06-lambda-functions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/README.md b/exercises/06-lambda-functions/README.md index 49de6bc..771ef04 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/06-lambda-functions/README.md @@ -18,7 +18,7 @@ def multiply(p1, p2): multiply = lambda p1,p2: p1 * p2 ``` -👉 Facts: +### 👉 Facts: + **Lambda functions** have to always be very small. From d0061978a58be20b78356d4e34a1c7350789ef8c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:58:15 +0100 Subject: [PATCH 120/165] Update app.py --- exercises/06-lambda-functions/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/app.py b/exercises/06-lambda-functions/app.py index e59626e..b4ac556 100755 --- a/exercises/06-lambda-functions/app.py +++ b/exercises/06-lambda-functions/app.py @@ -1,2 +1,2 @@ -# your function here +# Your function here From e1585015c20166dd3767800809e99ad01ccf7ff5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:59:29 +0100 Subject: [PATCH 121/165] Update tests.py --- exercises/06-lambda-functions/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06-lambda-functions/tests.py b/exercises/06-lambda-functions/tests.py index bce6293..aa3054a 100755 --- a/exercises/06-lambda-functions/tests.py +++ b/exercises/06-lambda-functions/tests.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Declare a function 'is_odd' as lambda") +@pytest.mark.it("Declare a function called 'is_odd' as lambda") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -13,7 +13,7 @@ def test_for_callable(capsys): import app as app assert callable(app.is_odd) -@pytest.mark.it('The function is_odd must receive one number and return true if is odd or false otherwise') +@pytest.mark.it('The function is_odd must receive one number and return True if the number is odd or False otherwise') def test_for_integer(capsys): import app as app assert app.is_odd(3) == True @@ -21,4 +21,4 @@ def test_for_integer(capsys): @pytest.mark.it('We tested the function with 2 and the result was not False') def test_for_integer2(capsys): import app as app - assert app.is_odd(2) == False \ No newline at end of file + assert app.is_odd(2) == False From f7e459f220fd7dd3c93284fb5884c139d969db9b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 01:59:44 +0100 Subject: [PATCH 122/165] Update tests.py --- exercises/06-lambda-functions/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/tests.py b/exercises/06-lambda-functions/tests.py index aa3054a..8b8655b 100755 --- a/exercises/06-lambda-functions/tests.py +++ b/exercises/06-lambda-functions/tests.py @@ -8,7 +8,7 @@ def test_declare_variable(): regex = re.compile(r"is_odd(\s*)=(\s*)lambda") assert bool(regex.search(content)) == True -@pytest.mark.it('The function is_odd must exist') +@pytest.mark.it("The function 'is_odd' must exist") def test_for_callable(capsys): import app as app assert callable(app.is_odd) From 0d2ba13d13a2ef4b5c6a90e5f7e4358225e36476 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:00:13 +0100 Subject: [PATCH 123/165] Update tests.py --- exercises/06-lambda-functions/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06-lambda-functions/tests.py b/exercises/06-lambda-functions/tests.py index 8b8655b..aa3054a 100755 --- a/exercises/06-lambda-functions/tests.py +++ b/exercises/06-lambda-functions/tests.py @@ -8,7 +8,7 @@ def test_declare_variable(): regex = re.compile(r"is_odd(\s*)=(\s*)lambda") assert bool(regex.search(content)) == True -@pytest.mark.it("The function 'is_odd' must exist") +@pytest.mark.it('The function is_odd must exist') def test_for_callable(capsys): import app as app assert callable(app.is_odd) From 0de3fbff5bf6e718f96e76b2f3ac07e59b367afa Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:01:52 +0100 Subject: [PATCH 124/165] Create solution.hide.py --- exercises/06-lambda-functions/solution.hide.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 exercises/06-lambda-functions/solution.hide.py diff --git a/exercises/06-lambda-functions/solution.hide.py b/exercises/06-lambda-functions/solution.hide.py new file mode 100644 index 0000000..f134619 --- /dev/null +++ b/exercises/06-lambda-functions/solution.hide.py @@ -0,0 +1,3 @@ +# Your function here + +is_odd = lambda num: num % 2 != 0 From 7877337c6b1f88c93ebd701e624c0c3bdc08a1d3 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:05:52 +0100 Subject: [PATCH 125/165] Update README.md --- exercises/07-lambda-function-two/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/07-lambda-function-two/README.md b/exercises/07-lambda-function-two/README.md index 69fa2ce..8659fd1 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/07-lambda-function-two/README.md @@ -2,23 +2,23 @@ tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" --- -# `07` Lambda functions +# `07` Lambda Functions -**:point_up: Remember:** +### ☝ Remember: Lambda functions allows a short syntax for writing function expressions. ```python -multy = lambda x, y: x * y -print(multy(2,2)) +multi = lambda x, y: x * y +print(multi(2,2)) ``` ## 📝 Instructions: -1. Create a lambda function called `rapid` it will take one string parameter. +1. Create a lambda function called `rapid`, which will take one string parameter. 2. Return the same string with the last letter removed. -## 💡 Hint +## 💡 Hint: -+ Google how to "remove last letter form string python" (you can use the square brackets). ++ Google "how to remove last letter from string python" (you can use the square brackets). From 7c657c271daf6e1c22cd68048a73943677b3b369 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:06:37 +0100 Subject: [PATCH 126/165] Update README.md --- exercises/07-lambda-function-two/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07-lambda-function-two/README.md b/exercises/07-lambda-function-two/README.md index 8659fd1..dcad70e 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/07-lambda-function-two/README.md @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" ### ☝ Remember: -Lambda functions allows a short syntax for writing function expressions. +Lambda functions allow a short syntax for writing function expressions. ```python multi = lambda x, y: x * y From 7f5cc84ec62cbe5d234a2001ab9377f99e0b7233 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:10:39 +0100 Subject: [PATCH 127/165] Update README.es.md --- exercises/07-lambda-function-two/README.es.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exercises/07-lambda-function-two/README.es.md b/exercises/07-lambda-function-two/README.es.md index e9f470b..53c054e 100644 --- a/exercises/07-lambda-function-two/README.es.md +++ b/exercises/07-lambda-function-two/README.es.md @@ -1,13 +1,12 @@ -# `07` Funciones Lambda +# `07` Lambda Functions - -**:point_up: Recuerda:** +### ☝ Recuerda: Las funciones Lambda permiten una sintaxis corta para escribir expresiones de funciones. ```python -multy = lambda x, y: x * y -print(multy(2,2)) +multi = lambda x, y: x * y +print(multi(2,2)) ``` ## 📝 Instrucciones: @@ -18,4 +17,4 @@ print(multy(2,2)) ## 💡 Pista: -+ Busca en Google "remove last letter form string python" (puedes usar los corchetes). ++ Busca en Google "como eliminar el último caracter de un string python" (puedes usar los corchetes). From a18d892882154e6a8ec105afbc9a1ef2e3a012bf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:11:54 +0100 Subject: [PATCH 128/165] Update app.py --- exercises/07-lambda-function-two/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-lambda-function-two/app.py b/exercises/07-lambda-function-two/app.py index fca265d..a156102 100755 --- a/exercises/07-lambda-function-two/app.py +++ b/exercises/07-lambda-function-two/app.py @@ -1,5 +1,5 @@ -# From this line above, plese do not change code below -print(rapid("bob")) #should print bo \ No newline at end of file +# Your code above, please do not change code below +print(rapid("bob")) # Should print "bo" From 0280a20f6b0b4bfed844a0406bedef1a1f0c67bc Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:14:22 +0100 Subject: [PATCH 129/165] Update solution.hide.py --- exercises/07-lambda-function-two/solution.hide.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/07-lambda-function-two/solution.hide.py b/exercises/07-lambda-function-two/solution.hide.py index 963f084..ecfc065 100644 --- a/exercises/07-lambda-function-two/solution.hide.py +++ b/exercises/07-lambda-function-two/solution.hide.py @@ -1,5 +1,4 @@ rapid = lambda myStr: myStr[:-1] - -# From this line above, plese do not change code below -print(rapid("bob")) #should print bo \ No newline at end of file +# Your code above, please do not change code below +print(rapid("bob")) # Should print "bo" From daa03e4b741f1daca80b997194fdcc5580132b58 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:16:33 +0100 Subject: [PATCH 130/165] Update tests.py --- exercises/07-lambda-function-two/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-lambda-function-two/tests.py b/exercises/07-lambda-function-two/tests.py index 39787f2..7b6a474 100755 --- a/exercises/07-lambda-function-two/tests.py +++ b/exercises/07-lambda-function-two/tests.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Declare a function 'rapid' as lambda") +@pytest.mark.it("Declare a function called 'rapid' as lambda") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -12,7 +12,7 @@ def test_declare_variable(): def test_for_callable(capsys): from app import rapid -@pytest.mark.it('The function rapid must receive one string and return the same but without the last letter (make sure it\'s lowecase)') +@pytest.mark.it('The function rapid must receive one string and return the same string without the last character') def test_for_integer(capsys): from app import rapid assert rapid("maria") == "mari" From 44a898b1fb9d4354a653438a3e25fc4f5732e80c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:29:44 +0100 Subject: [PATCH 131/165] Update README.md --- exercises/08-Function-that-returns/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/08-Function-that-returns/README.md b/exercises/08-Function-that-returns/README.md index cd56ca6..b84d2e1 100755 --- a/exercises/08-Function-that-returns/README.md +++ b/exercises/08-Function-that-returns/README.md @@ -8,18 +8,17 @@ It is very good practice that all functions return something, even if it is `Non With what your function returns, you can create algorithms that use multiple functions at the same time. -For example, in this particular case we have two functions available: +For example, in this particular case, we have two functions available: + `dollar_to_euro`: that calculates the value in euros of a given value in dollars. + `euro_to_yen`: calculates the value in yen of a given value in euros. - ## 📝 Instructions: 1. Using the two functions available, print on the console the value of **137** dollars in yen. -## 💡 Hint +## 💡 Hint: Working backwards: @@ -27,4 +26,4 @@ Working backwards: - Our available function `euro_to_yen` will provide that. -- To get to euro we will use the available function `dollar_to_euro`. +- To get the euros, we will use the available function `dollar_to_euro`. From 930f773763975a9a27c2de8f13d70707c51f5da0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:31:16 +0100 Subject: [PATCH 132/165] Update README.md --- exercises/08-Function-that-returns/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/08-Function-that-returns/README.md b/exercises/08-Function-that-returns/README.md index b84d2e1..1f4a6d7 100755 --- a/exercises/08-Function-that-returns/README.md +++ b/exercises/08-Function-that-returns/README.md @@ -18,7 +18,7 @@ For example, in this particular case, we have two functions available: 1. Using the two functions available, print on the console the value of **137** dollars in yen. -## 💡 Hint: +## 💡 Hints: Working backwards: From 08490fe19fb2e69260a6b1742158f3cf632aacad Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:32:18 +0100 Subject: [PATCH 133/165] Update README.es.md --- exercises/08-Function-that-returns/README.es.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exercises/08-Function-that-returns/README.es.md b/exercises/08-Function-that-returns/README.es.md index cd6fd25..add2e88 100644 --- a/exercises/08-Function-that-returns/README.es.md +++ b/exercises/08-Function-that-returns/README.es.md @@ -1,8 +1,10 @@ -# `08` Funciones que devuelven +# `08` Functions that return Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None`. -Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. Por ejemplo, en este caso en particular tenemos dos funciones disponibles: +Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. + +Por ejemplo, en este caso en particular tenemos dos funciones disponibles: + `dollar_to_euro`: que calcula el valor en euros de un valor dado en dólares. @@ -12,12 +14,12 @@ Si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funcion 1. Utilizando las dos funciones disponibles, imprime en la consola el valor de **137** dólares en yenes. -## 💡 Pista: +## 💡 Pistas: -Trabajando al revés: +Trabajando desde el final: - Nuestro valor esperado está en yenes. - Nuestra función disponible `euro_to_yen` proporcionará eso. -- Para llegar al euro utilizaremos la función disponible `dollar_to_euro`. \ No newline at end of file +- Para llegar al euro utilizaremos la función disponible `dollar_to_euro`. From eaefd88b6d4fec91a545ffe8b80e167f2b6891a6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:34:31 +0100 Subject: [PATCH 134/165] Update app.py --- exercises/08-Function-that-returns/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/08-Function-that-returns/app.py b/exercises/08-Function-that-returns/app.py index 44ab611..fc81947 100755 --- a/exercises/08-Function-that-returns/app.py +++ b/exercises/08-Function-that-returns/app.py @@ -1,7 +1,7 @@ def dollar_to_euro(dollar_value): - return dollar_value * 0.89 + return dollar_value * 0.91 def euro_to_yen(euro_value): - return euro_value * 124.15 + return euro_value * 161.70 -####### ↓ YOUR CODE BELOW ↓ ####### \ No newline at end of file +####### ↓ YOUR CODE BELOW ↓ ####### From 50e2eec84f45f9ae1388ac79513a56d3cca19794 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:35:17 +0100 Subject: [PATCH 135/165] Update test.py --- exercises/08-Function-that-returns/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/08-Function-that-returns/test.py b/exercises/08-Function-that-returns/test.py index 812e1c7..f45e234 100755 --- a/exercises/08-Function-that-returns/test.py +++ b/exercises/08-Function-that-returns/test.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Call the function dollar_to_euro passing the 137 dollars to get the amount in Euro") +@pytest.mark.it("Call the function dollar_to_euro passing 137 dollars to get the amount in Euros") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -9,7 +9,7 @@ def test_declare_variable(): assert bool(regex.search(content)) == True -@pytest.mark.it("Call the function euro_to_yen passing the Euro converted amount to get the amount in Yen") +@pytest.mark.it("Call the function euro_to_yen passing the Euros converted amount to get the amount in Yen") def test_euro_to_yen(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -22,4 +22,4 @@ def test_euro_to_yen(): def test_for_file_output(capsys): import app captured = capsys.readouterr() - assert "15137.609500000002\n" == captured.out \ No newline at end of file + assert "20159.139\n" == captured.out From 114310ed2d5692d2b28fe5a033b2ef84735af473 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:40:17 +0100 Subject: [PATCH 136/165] Create solution.hide.py --- exercises/08-Function-that-returns/solution.hide.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 exercises/08-Function-that-returns/solution.hide.py diff --git a/exercises/08-Function-that-returns/solution.hide.py b/exercises/08-Function-that-returns/solution.hide.py new file mode 100644 index 0000000..82ee742 --- /dev/null +++ b/exercises/08-Function-that-returns/solution.hide.py @@ -0,0 +1,12 @@ +def dollar_to_euro(dollar_value): + return dollar_value * 0.91 + +def euro_to_yen(euro_value): + return euro_value * 161.70 + +####### ↓ YOUR CODE BELOW ↓ ####### + +euros = dollar_to_euro(137) +yen = euro_to_yen(euros) + +print(yen) From 989a756e22cbb997f75894a7d9561cfd2fbb9736 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:50:56 +0100 Subject: [PATCH 137/165] Update README.md --- exercises/09-Function-parameters/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/09-Function-parameters/README.md b/exercises/09-Function-parameters/README.md index 1301c1a..d8a4321 100755 --- a/exercises/09-Function-parameters/README.md +++ b/exercises/09-Function-parameters/README.md @@ -6,18 +6,20 @@ tutorial: "https://www.youtube.com/watch?v=uaiDxW4LJNA" You can specify as many parameters as you want in a function. -As a developer you are going to find functions with even 6 or 7 parameters all the time. +As a developer, you are going to find functions with even 6 or 7 parameters all the time. The names of the parameters don't matter, but you have to be **as explicit as you can** because these names will give clues to the other developers (or yourself in the future) about what is each parameter about. ## 📝 Instructions: -1. Please write the `render_person` function required to print a a string like the following: +1. Please write the `render_person` function required to print a string like the following: -```py +```text Bob is a 23 years old male born in 05/22/1983 with green eyes ``` -## 💡 Hint +## 💡 Hints: + You have to do some string concatenation and return that string. + ++ Also, you can Google "how to insert variables into a string python". From cecf0db8be1200824fe3c0f7f172d168988d904d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:54:03 +0100 Subject: [PATCH 138/165] Update README.es.md --- exercises/09-Function-parameters/README.es.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/09-Function-parameters/README.es.md b/exercises/09-Function-parameters/README.es.md index 6500706..98c3c7d 100644 --- a/exercises/09-Function-parameters/README.es.md +++ b/exercises/09-Function-parameters/README.es.md @@ -1,4 +1,4 @@ -# `09` Parámetros de funciones +# `09` Function parameters Puedes especificar tantos parámetros como desees en una función. @@ -10,10 +10,12 @@ Los nombres de los parámetros no importan, pero debe ser **lo más explícito p + Escribe la función `render_person` requerida para imprimir un string como el siguiente: -```py +```text Bob is a 23 years old male born in 05/22/1983 with green eyes ``` -## 💡 Pista +## 💡 Pistas: -- Tienes que hacer una concatenación de string y devolver ese string. ++ Tienes que hacer una concatenación de string y devolver ese string. + ++ También, puedes buscar en Google "como insertar variables en un string python". From 71fe9b01f1c22db7b559d6274913d77225342191 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:57:29 +0100 Subject: [PATCH 139/165] Update solution.hide.py --- exercises/09-Function-parameters/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/09-Function-parameters/solution.hide.py b/exercises/09-Function-parameters/solution.hide.py index 71e6d5f..1b50585 100644 --- a/exercises/09-Function-parameters/solution.hide.py +++ b/exercises/09-Function-parameters/solution.hide.py @@ -1,7 +1,7 @@ # Your code goes here: -def render_person(name, birthdate, eye_color, age, sex): - return name +" is a "+ str(age) +" years old " + sex +" born in " + birthdate + " with "+eye_color +" eyes" +def render_person(name, birth_date, eye_color, age, gender): + return name + " is a " + str(age) + " years old " + gender + " born in " + birth_date + " with " + eye_color + " eyes" # Do not edit below this line -print(render_person('Bob', '05/22/1983', 'green', 23, 'male')) \ No newline at end of file +print(render_person('Bob', '05/22/1983', 'green', 23, 'male')) From af4d5fd3997409841f39089238d31f0b173ea764 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:59:05 +0100 Subject: [PATCH 140/165] Update README.es.md --- exercises/09-Function-parameters/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/09-Function-parameters/README.es.md b/exercises/09-Function-parameters/README.es.md index 98c3c7d..ca03d09 100644 --- a/exercises/09-Function-parameters/README.es.md +++ b/exercises/09-Function-parameters/README.es.md @@ -8,7 +8,7 @@ Los nombres de los parámetros no importan, pero debe ser **lo más explícito p ## 📝 Instrucciones: -+ Escribe la función `render_person` requerida para imprimir un string como el siguiente: +1. Escribe la función `render_person` requerida para imprimir un string como el siguiente: ```text Bob is a 23 years old male born in 05/22/1983 with green eyes From 91c9d46426d430b76e4c84280ad6ca4ffec0dfd6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:05:01 +0100 Subject: [PATCH 141/165] Update README.md --- exercises/10-Array-Methods/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/10-Array-Methods/README.md b/exercises/10-Array-Methods/README.md index 26cc991..950a653 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/10-Array-Methods/README.md @@ -2,16 +2,15 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" --- - # `10` List Methods ## 📝 Instructions: 1. Write a function called `sort_names` that, given a list of names, returns them in alphabetical order. -## 💡 Hint +## 💡 Hints: -+ Every list comes with default functions that allows sorting- use it inside your function! ++ Every list comes with default functions that allow sorting - use it inside your function! + Stuck on sorting? Read W3 Schools page on sorting lists: From a5eafd979df694a429b62f8a0b9ae9fe83c63632 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:06:55 +0100 Subject: [PATCH 142/165] Update README.md --- exercises/10-Array-Methods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Array-Methods/README.md b/exercises/10-Array-Methods/README.md index 950a653..0a53c67 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/10-Array-Methods/README.md @@ -12,6 +12,6 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" + Every list comes with default functions that allow sorting - use it inside your function! -+ Stuck on sorting? Read W3 Schools page on sorting lists: ++ Stuck on sorting? Read the W3 Schools page on sorting lists: https://www.w3schools.com/python/ref_list_sort.asp From 3f6d9975200b60bd1d467befc57d07f5baddb79f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:07:23 +0100 Subject: [PATCH 143/165] Update README.md --- exercises/10-Array-Methods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Array-Methods/README.md b/exercises/10-Array-Methods/README.md index 0a53c67..e91d7f6 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/10-Array-Methods/README.md @@ -10,7 +10,7 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" ## 💡 Hints: -+ Every list comes with default functions that allow sorting - use it inside your function! ++ Every list comes with default functions that allow sorting - use them inside your function! + Stuck on sorting? Read the W3 Schools page on sorting lists: From 8bfd0bc73f4c52fd7272e60a0cb0932bc59eace6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:08:21 +0100 Subject: [PATCH 144/165] Update README.es.md --- exercises/10-Array-Methods/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/10-Array-Methods/README.es.md b/exercises/10-Array-Methods/README.es.md index 938c2ad..1c2810b 100644 --- a/exercises/10-Array-Methods/README.es.md +++ b/exercises/10-Array-Methods/README.es.md @@ -1,13 +1,13 @@ -# `10` Métodos de listas +# `10` List Methods ## 📝 Instrucciones: 1. Escribe una función llamada `sort_names` que dada una lista de nombres, los devuelva en orden alfabético. -## 💡 Pista: +## 💡 Pistas: -- Cada lista viene con funciones predeterminadas que permiten ordenarla ¡úsalas dentro de tu función! +- Cada lista viene con funciones predeterminadas que permiten ordenarla, ¡úsalas dentro de tu función! -+ ¿Atrapado en el orden? Lee esta página sobre cómo ordenar listas: ++ ¿Atascado? Lee esta página sobre cómo ordenar listas: -https://www.freecodecamp.org/espanol/news/python-ordenar-lista-con-sort-ascendente-y-descendente-explicado-con-ejemplos/ \ No newline at end of file +https://www.freecodecamp.org/espanol/news/python-ordenar-lista-con-sort-ascendente-y-descendente-explicado-con-ejemplos/ From 4b35a989b4ef58c93b5e89ea59a7e8fe8e02c566 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:09:39 +0100 Subject: [PATCH 145/165] Update solution.hide.py --- exercises/10-Array-Methods/solution.hide.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/10-Array-Methods/solution.hide.py b/exercises/10-Array-Methods/solution.hide.py index f63fbd8..37e6930 100644 --- a/exercises/10-Array-Methods/solution.hide.py +++ b/exercises/10-Array-Methods/solution.hide.py @@ -1,2 +1,8 @@ +names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] + +## CREATE YOUR FUNCTION HERE def sort_names (arr): return sorted(arr) + + +print(sort_names(names)) From 3c028564a1de7425bf2b620f849056ce0d60bf4d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:09:58 +0100 Subject: [PATCH 146/165] Update app.py --- exercises/10-Array-Methods/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/10-Array-Methods/app.py b/exercises/10-Array-Methods/app.py index c88bc18..9d60f6b 100755 --- a/exercises/10-Array-Methods/app.py +++ b/exercises/10-Array-Methods/app.py @@ -1,4 +1,6 @@ names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] + ## CREATE YOUR FUNCTION HERE + print(sort_names(names)) From a229f3077e4236663d6575335f7a54349e036f9b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:12:27 +0100 Subject: [PATCH 147/165] Update README.md --- exercises/10-Array-Methods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Array-Methods/README.md b/exercises/10-Array-Methods/README.md index e91d7f6..69316e3 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/10-Array-Methods/README.md @@ -14,4 +14,4 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" + Stuck on sorting? Read the W3 Schools page on sorting lists: -https://www.w3schools.com/python/ref_list_sort.asp +https://www.w3schools.com/python/ref_func_sorted.asp From 355a13aeea30635a19c52a1ad7e40609b0a7910a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:13:43 +0100 Subject: [PATCH 148/165] Update tests.py --- exercises/10-Array-Methods/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/10-Array-Methods/tests.py b/exercises/10-Array-Methods/tests.py index 76a6c4d..5cce1e5 100755 --- a/exercises/10-Array-Methods/tests.py +++ b/exercises/10-Array-Methods/tests.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it("Declare the function sort_names") +@pytest.mark.it("Declare the function 'sort_names'") def test_declare_variable(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: @@ -13,7 +13,7 @@ def test_declare_variable(): def test_for_functon_existence(capsys, app): assert callable(app.sort_names) -@pytest.mark.it('The function sort_names must accept 1 parameter and return a sorted one') +@pytest.mark.it('The function sort_names must accept a list and return a sorted one') def test_for_file_output(capsys): import app captured = capsys.readouterr() From b681c43699d487c4100e8e0a01b886a55c7d5d44 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:17:33 +0100 Subject: [PATCH 149/165] Update README.md --- exercises/07-lambda-function-two/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-lambda-function-two/README.md b/exercises/07-lambda-function-two/README.md index dcad70e..8796c77 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/07-lambda-function-two/README.md @@ -9,8 +9,8 @@ tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" Lambda functions allow a short syntax for writing function expressions. ```python -multi = lambda x, y: x * y -print(multi(2,2)) +multiply = lambda x, y: x * y +print(multiply(2,2)) ``` ## 📝 Instructions: From a43808123104b2e57d780570c9f81db70f8c5ff5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:17:44 +0100 Subject: [PATCH 150/165] Update README.es.md --- exercises/07-lambda-function-two/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-lambda-function-two/README.es.md b/exercises/07-lambda-function-two/README.es.md index 53c054e..c85e631 100644 --- a/exercises/07-lambda-function-two/README.es.md +++ b/exercises/07-lambda-function-two/README.es.md @@ -5,8 +5,8 @@ Las funciones Lambda permiten una sintaxis corta para escribir expresiones de funciones. ```python -multi = lambda x, y: x * y -print(multi(2,2)) +multiply = lambda x, y: x * y +print(multiply(2,2)) ``` ## 📝 Instrucciones: From 30ccbe7ee0d68eaafcbef4008f5dce75a613ae3d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:10:50 +0100 Subject: [PATCH 151/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b224b1..8a28fc2 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ $ npm i learnpack -g && learnpack plugins:install learnpack-python 2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. ```bash -$ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git +$ git clone https://github.com/4GeeksAcademy/python-beginner-programming-exercises.git ``` 3) Start the tutorial/exercises by running the following command from the root of the project: From ff4cc7e91fe797136c0239473b17515bd00d4041 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:13:00 +0100 Subject: [PATCH 152/165] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a28fc2..774a396 100644 --- a/README.md +++ b/README.md @@ -43,14 +43,14 @@ $ npm i learnpack -g && learnpack plugins:install learnpack-python 2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. ```bash -$ git clone https://github.com/4GeeksAcademy/python-beginner-programming-exercises.git +$ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git ``` 3) Start the tutorial/exercises by running the following command from the root of the project: ```bash $ cd python-functions-programming-exercises -$ pip install pytest==4.4.2 mock pytest-testdox +$ pip3 install pytest==6.2.5 pytest-testdox mock $ learnpack start ``` From 63202b9dda948c17bc5bac97ea9ddf7dab70cb1f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:14:47 +0100 Subject: [PATCH 153/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 774a396..bdaa768 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You can open these exercises in just a few seconds by clicking: [Open in Codespa 1) Make sure you have [LearnPack](https://learnpack.co) installed, node.js version 14+, and Python version 3+. This is the command to install LearnPack: ```bash -$ npm i learnpack -g && learnpack plugins:install learnpack-python +$ npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 ``` 2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. From cc216be849ac02871bc3c7408f50765f4d671199 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:18:53 +0100 Subject: [PATCH 154/165] Update README.es.md --- README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.es.md b/README.es.md index 27f2c3e..52f29df 100644 --- a/README.es.md +++ b/README.es.md @@ -34,7 +34,7 @@ Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Co 1) Asegúrate de instalar [LearnPack](https://learnpack.co), node.js version 14+ y Python version 3+. Este es el comando para instalar LearnPack: ```bash -$ npm i learnpack -g && learnpack plugins:install learnpack-python +$ npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 ``` 2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás una carpeta nueva con un subdirectorio llamado "exercises" que contiene los ejercicios. @@ -47,7 +47,7 @@ $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exerci ```bash $ cd python-functions-programming-exercises -$ pip install pytest==4.4.2 mock pytest-testdox +$ pip3 install pytest==6.2.5 pytest-testdox mock $ learnpack start ``` From de8d27b153751a1b2e41ca8badf2618490619807 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:20:05 +0100 Subject: [PATCH 155/165] Update README.es.md --- README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.es.md b/README.es.md index 52f29df..e9c0b31 100644 --- a/README.es.md +++ b/README.es.md @@ -67,7 +67,7 @@ Cada ejercicio es un pequeño proyecto en Python que contiene los siguientes arc Gracias a estas personas maravillosas ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): -1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 🤓, (build-tutorial) ✅, (documentación) 📖 +1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribución: (programador) 💻, (idea) 🤔, (build-tests) ⚠️, (pull-request-review) 👀, (build-tutorial) ✅, (documentación) 📖 2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) 🐛, (programador) 💻, (traducción) 🌎 From ed10076fe156ee76b95f2223813113a5a731eed9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:36:02 +0100 Subject: [PATCH 156/165] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bdaa768..b54a2d3 100644 --- a/README.md +++ b/README.md @@ -34,22 +34,22 @@ You can open these exercises in just a few seconds by clicking: [Open in Codespa ## Local Installation -1) Make sure you have [LearnPack](https://learnpack.co) installed, node.js version 14+, and Python version 3+. This is the command to install LearnPack: +1. Make sure you have [LearnPack](https://learnpack.co) installed, node.js version 14+, and Python version 3+. This is the command to install LearnPack: ```bash $ npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 ``` -2) Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. +2. Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. ```bash $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git +$ cd python-functions-programming-exercises ``` -3) Start the tutorial/exercises by running the following command from the root of the project: +3. Start the tutorial/exercises by running the following command from the root of the project: ```bash -$ cd python-functions-programming-exercises $ pip3 install pytest==6.2.5 pytest-testdox mock $ learnpack start ``` From b73c98b26ed1f69ffbebf6807252d321be30212d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:37:44 +0100 Subject: [PATCH 157/165] Update README.es.md --- README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.es.md b/README.es.md index e9c0b31..ea7f4dd 100644 --- a/README.es.md +++ b/README.es.md @@ -31,22 +31,22 @@ Puedes empezar estos ejercicios en pocos segundos haciendo clic en: [Abrir en Co ## Instalación local: -1) Asegúrate de instalar [LearnPack](https://learnpack.co), node.js version 14+ y Python version 3+. Este es el comando para instalar LearnPack: +1. Asegúrate de instalar [LearnPack](https://learnpack.co), node.js version 14+ y Python version 3+. Este es el comando para instalar LearnPack: ```bash $ npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 ``` -2) Clona o descarga este repositorio. Una vez que termines de descargar, encontrarás una carpeta nueva con un subdirectorio llamado "exercises" que contiene los ejercicios. +2. Clona o descarga este repositorio en tu ambiente local. ```bash $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git +$ cd python-functions-programming-exercises ``` -3) Comienza el tutorial/ejercicios ejecutando el siguiente comando en la raíz del proyecto: +3. Comienza el tutorial/ejercicios ejecutando el siguiente comando en la raíz del proyecto: ```bash -$ cd python-functions-programming-exercises $ pip3 install pytest==6.2.5 pytest-testdox mock $ learnpack start ``` From bb9e11d189c43f4d5e19e890b279bb979d8ab793 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:38:15 +0100 Subject: [PATCH 158/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b54a2d3..424713c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ You can open these exercises in just a few seconds by clicking: [Open in Codespa $ npm i -g @learnpack/learnpack@2.1.20 && learnpack plugins:install @learnpack/python@1.0.0 ``` -2. Clone or download this repository. Once you finish downloading, you will find a new folder with a subdirectory called "exercises" that contains all the exercises within. +2. Clone or download this repository in your local environment. ```bash $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exercises.git From 9084eee8acba1c7e523eaa03b29948a3ec790aa2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:43:21 +0100 Subject: [PATCH 159/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 424713c..c52205e 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ $ learnpack start ## How are the exercises organized? -Each exercise is a small React application containing the following files: +Each exercise is a small Python application containing the following files: 1. **app.py:** represents the entry Python file that will be executed by the computer. 2. **README.md:** contains exercise instructions. From fd801fd84e945aa896ce66564f9eb24315e45428 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:55:37 +0100 Subject: [PATCH 160/165] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c52205e..18994a9 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exerci $ cd python-functions-programming-exercises ``` +> Note: Once you finish downloading, you will find an "exercises" folder that contains all the exercises within. + 3. Start the tutorial/exercises by running the following command from the root of the project: ```bash From e2ac839c33e1ec091e5a2db51bf13f0a48d3616e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:56:01 +0100 Subject: [PATCH 161/165] Update README.es.md --- README.es.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.es.md b/README.es.md index ea7f4dd..70a7973 100644 --- a/README.es.md +++ b/README.es.md @@ -44,6 +44,8 @@ $ git clone https://github.com/4GeeksAcademy/python-functions-programming-exerci $ cd python-functions-programming-exercises ``` +> Nota: Una vez que termine de descargar, encontrarás la carpeta "exercises" que contiene todos los ejercicios. + 3. Comienza el tutorial/ejercicios ejecutando el siguiente comando en la raíz del proyecto: ```bash From f17dff4b755a198213fe2ce57fc577340ef55202 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:18:23 +0000 Subject: [PATCH 162/165] cambio de numeros a todo para poner el 00-welcome --- exercises/{01-hello-world => 00-Welcome}/README.es.md | 0 exercises/{01-hello-world => 00-Welcome}/README.md | 0 exercises/{02-Hello-World => 01-Hello-World}/README.es.md | 2 +- exercises/{02-Hello-World => 01-Hello-World}/README.md | 2 +- exercises/{02-Hello-World => 01-Hello-World}/app.py | 0 exercises/{02-Hello-World => 01-Hello-World}/solution.hide.py | 0 exercises/{02-Hello-World => 01-Hello-World}/test.py | 0 .../README.es.md | 2 +- .../{03-What-is-a-function => 02-What-is-a-function}/README.md | 2 +- .../{03-What-is-a-function => 02-What-is-a-function}/app.py | 0 .../solution.hide.py | 0 .../{03-What-is-a-function => 02-What-is-a-function}/tests.py | 0 .../{04-Call-a-function => 03-Call-a-function}/README.es.md | 2 +- exercises/{04-Call-a-function => 03-Call-a-function}/README.md | 2 +- exercises/{04-Call-a-function => 03-Call-a-function}/app.py | 0 .../{04-Call-a-function => 03-Call-a-function}/solution.hide.py | 0 exercises/{04-Call-a-function => 03-Call-a-function}/tests.py | 0 .../README.es.md | 2 +- .../README.md | 2 +- .../app.py | 0 .../solution.hide.py | 0 .../tests.py | 0 .../{06-lambda-functions => 05-lambda-functions}/README.es.md | 2 +- .../{06-lambda-functions => 05-lambda-functions}/README.md | 2 +- exercises/{06-lambda-functions => 05-lambda-functions}/app.py | 0 .../solution.hide.py | 0 exercises/{06-lambda-functions => 05-lambda-functions}/tests.py | 0 .../README.es.md | 2 +- .../README.md | 2 +- .../{07-lambda-function-two => 06-lambda-function-two}/app.py | 0 .../solution.hide.py | 0 .../{07-lambda-function-two => 06-lambda-function-two}/tests.py | 0 .../README.es.md | 2 +- .../README.md | 2 +- .../app.py | 0 .../solution.hide.py | 0 .../test.py | 0 .../README.es.md | 2 +- .../README.md | 2 +- .../{09-Function-parameters => 08-Function-parameters}/app.py | 0 .../solution.hide.py | 0 .../{09-Function-parameters => 08-Function-parameters}/tests.py | 0 exercises/{10-Array-Methods => 09-Array-Methods}/README.es.md | 2 +- exercises/{10-Array-Methods => 09-Array-Methods}/README.md | 2 +- exercises/{10-Array-Methods => 09-Array-Methods}/app.py | 0 .../{10-Array-Methods => 09-Array-Methods}/solution.hide.py | 0 exercises/{10-Array-Methods => 09-Array-Methods}/tests.py | 0 47 files changed, 18 insertions(+), 18 deletions(-) rename exercises/{01-hello-world => 00-Welcome}/README.es.md (100%) rename exercises/{01-hello-world => 00-Welcome}/README.md (100%) rename exercises/{02-Hello-World => 01-Hello-World}/README.es.md (97%) rename exercises/{02-Hello-World => 01-Hello-World}/README.md (97%) rename exercises/{02-Hello-World => 01-Hello-World}/app.py (100%) rename exercises/{02-Hello-World => 01-Hello-World}/solution.hide.py (100%) rename exercises/{02-Hello-World => 01-Hello-World}/test.py (100%) rename exercises/{03-What-is-a-function => 02-What-is-a-function}/README.es.md (96%) rename exercises/{03-What-is-a-function => 02-What-is-a-function}/README.md (96%) rename exercises/{03-What-is-a-function => 02-What-is-a-function}/app.py (100%) rename exercises/{03-What-is-a-function => 02-What-is-a-function}/solution.hide.py (100%) rename exercises/{03-What-is-a-function => 02-What-is-a-function}/tests.py (100%) rename exercises/{04-Call-a-function => 03-Call-a-function}/README.es.md (98%) rename exercises/{04-Call-a-function => 03-Call-a-function}/README.md (97%) rename exercises/{04-Call-a-function => 03-Call-a-function}/app.py (100%) rename exercises/{04-Call-a-function => 03-Call-a-function}/solution.hide.py (100%) rename exercises/{04-Call-a-function => 03-Call-a-function}/tests.py (100%) rename exercises/{05-Defining-vs-Calling-a-function => 04-Defining-vs-Calling-a-function}/README.es.md (98%) rename exercises/{05-Defining-vs-Calling-a-function => 04-Defining-vs-Calling-a-function}/README.md (98%) rename exercises/{05-Defining-vs-Calling-a-function => 04-Defining-vs-Calling-a-function}/app.py (100%) rename exercises/{05-Defining-vs-Calling-a-function => 04-Defining-vs-Calling-a-function}/solution.hide.py (100%) rename exercises/{05-Defining-vs-Calling-a-function => 04-Defining-vs-Calling-a-function}/tests.py (100%) rename exercises/{06-lambda-functions => 05-lambda-functions}/README.es.md (97%) rename exercises/{06-lambda-functions => 05-lambda-functions}/README.md (97%) rename exercises/{06-lambda-functions => 05-lambda-functions}/app.py (100%) rename exercises/{06-lambda-functions => 05-lambda-functions}/solution.hide.py (100%) rename exercises/{06-lambda-functions => 05-lambda-functions}/tests.py (100%) rename exercises/{07-lambda-function-two => 06-lambda-function-two}/README.es.md (95%) rename exercises/{07-lambda-function-two => 06-lambda-function-two}/README.md (95%) rename exercises/{07-lambda-function-two => 06-lambda-function-two}/app.py (100%) rename exercises/{07-lambda-function-two => 06-lambda-function-two}/solution.hide.py (100%) rename exercises/{07-lambda-function-two => 06-lambda-function-two}/tests.py (100%) rename exercises/{08-Function-that-returns => 07-Function-that-returns}/README.es.md (96%) rename exercises/{08-Function-that-returns => 07-Function-that-returns}/README.md (96%) rename exercises/{08-Function-that-returns => 07-Function-that-returns}/app.py (100%) rename exercises/{08-Function-that-returns => 07-Function-that-returns}/solution.hide.py (100%) rename exercises/{08-Function-that-returns => 07-Function-that-returns}/test.py (100%) rename exercises/{09-Function-parameters => 08-Function-parameters}/README.es.md (96%) rename exercises/{09-Function-parameters => 08-Function-parameters}/README.md (96%) rename exercises/{09-Function-parameters => 08-Function-parameters}/app.py (100%) rename exercises/{09-Function-parameters => 08-Function-parameters}/solution.hide.py (100%) rename exercises/{09-Function-parameters => 08-Function-parameters}/tests.py (100%) rename exercises/{10-Array-Methods => 09-Array-Methods}/README.es.md (95%) rename exercises/{10-Array-Methods => 09-Array-Methods}/README.md (95%) rename exercises/{10-Array-Methods => 09-Array-Methods}/app.py (100%) rename exercises/{10-Array-Methods => 09-Array-Methods}/solution.hide.py (100%) rename exercises/{10-Array-Methods => 09-Array-Methods}/tests.py (100%) diff --git a/exercises/01-hello-world/README.es.md b/exercises/00-Welcome/README.es.md similarity index 100% rename from exercises/01-hello-world/README.es.md rename to exercises/00-Welcome/README.es.md diff --git a/exercises/01-hello-world/README.md b/exercises/00-Welcome/README.md similarity index 100% rename from exercises/01-hello-world/README.md rename to exercises/00-Welcome/README.md diff --git a/exercises/02-Hello-World/README.es.md b/exercises/01-Hello-World/README.es.md similarity index 97% rename from exercises/02-Hello-World/README.es.md rename to exercises/01-Hello-World/README.es.md index 2ebad83..da0ecf5 100644 --- a/exercises/02-Hello-World/README.es.md +++ b/exercises/01-Hello-World/README.es.md @@ -1,4 +1,4 @@ -# `02` Hello World +# `01` Hello World En Python, usamos **print** para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un string dado, etc.) en algo llamado "la consola". diff --git a/exercises/02-Hello-World/README.md b/exercises/01-Hello-World/README.md similarity index 97% rename from exercises/02-Hello-World/README.md rename to exercises/01-Hello-World/README.md index 25b59bc..cd5ba73 100644 --- a/exercises/02-Hello-World/README.md +++ b/exercises/01-Hello-World/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=voBO7a0KPtE" --- -# `02` Hello World +# `01` Hello World In Python, we use **print** to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console". diff --git a/exercises/02-Hello-World/app.py b/exercises/01-Hello-World/app.py similarity index 100% rename from exercises/02-Hello-World/app.py rename to exercises/01-Hello-World/app.py diff --git a/exercises/02-Hello-World/solution.hide.py b/exercises/01-Hello-World/solution.hide.py similarity index 100% rename from exercises/02-Hello-World/solution.hide.py rename to exercises/01-Hello-World/solution.hide.py diff --git a/exercises/02-Hello-World/test.py b/exercises/01-Hello-World/test.py similarity index 100% rename from exercises/02-Hello-World/test.py rename to exercises/01-Hello-World/test.py diff --git a/exercises/03-What-is-a-function/README.es.md b/exercises/02-What-is-a-function/README.es.md similarity index 96% rename from exercises/03-What-is-a-function/README.es.md rename to exercises/02-What-is-a-function/README.es.md index e1de4ff..bf34887 100644 --- a/exercises/03-What-is-a-function/README.es.md +++ b/exercises/02-What-is-a-function/README.es.md @@ -1,4 +1,4 @@ -# `03` What is a function? +# `02` What is a function? Puedes ver una función como un **fragmento de código** que puedes usar varias veces. diff --git a/exercises/03-What-is-a-function/README.md b/exercises/02-What-is-a-function/README.md similarity index 96% rename from exercises/03-What-is-a-function/README.md rename to exercises/02-What-is-a-function/README.md index 4f00844..5bd1324 100755 --- a/exercises/03-What-is-a-function/README.md +++ b/exercises/02-What-is-a-function/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=tgTLyZ0cKj4" --- -# `03` What is a function? +# `02` What is a function? You can see a function as a **fragment of code** we can use several times. diff --git a/exercises/03-What-is-a-function/app.py b/exercises/02-What-is-a-function/app.py similarity index 100% rename from exercises/03-What-is-a-function/app.py rename to exercises/02-What-is-a-function/app.py diff --git a/exercises/03-What-is-a-function/solution.hide.py b/exercises/02-What-is-a-function/solution.hide.py similarity index 100% rename from exercises/03-What-is-a-function/solution.hide.py rename to exercises/02-What-is-a-function/solution.hide.py diff --git a/exercises/03-What-is-a-function/tests.py b/exercises/02-What-is-a-function/tests.py similarity index 100% rename from exercises/03-What-is-a-function/tests.py rename to exercises/02-What-is-a-function/tests.py diff --git a/exercises/04-Call-a-function/README.es.md b/exercises/03-Call-a-function/README.es.md similarity index 98% rename from exercises/04-Call-a-function/README.es.md rename to exercises/03-Call-a-function/README.es.md index ae2c760..a81e346 100644 --- a/exercises/04-Call-a-function/README.es.md +++ b/exercises/03-Call-a-function/README.es.md @@ -1,7 +1,7 @@ --- tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" --- -# `04` Calling a Function +# `03` Calling a Function Una función podría recibir 0 parámetros y devolverá algo siempre, incluso si no añades explícitamente el `return`. diff --git a/exercises/04-Call-a-function/README.md b/exercises/03-Call-a-function/README.md similarity index 97% rename from exercises/04-Call-a-function/README.md rename to exercises/03-Call-a-function/README.md index 58e957f..7e1d9f5 100755 --- a/exercises/04-Call-a-function/README.md +++ b/exercises/03-Call-a-function/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" --- -# `04` Calling a Function +# `03` Calling a Function A function could receive zero parameters, and it always returns something, even if you don't explicitly add the `return` statement. diff --git a/exercises/04-Call-a-function/app.py b/exercises/03-Call-a-function/app.py similarity index 100% rename from exercises/04-Call-a-function/app.py rename to exercises/03-Call-a-function/app.py diff --git a/exercises/04-Call-a-function/solution.hide.py b/exercises/03-Call-a-function/solution.hide.py similarity index 100% rename from exercises/04-Call-a-function/solution.hide.py rename to exercises/03-Call-a-function/solution.hide.py diff --git a/exercises/04-Call-a-function/tests.py b/exercises/03-Call-a-function/tests.py similarity index 100% rename from exercises/04-Call-a-function/tests.py rename to exercises/03-Call-a-function/tests.py diff --git a/exercises/05-Defining-vs-Calling-a-function/README.es.md b/exercises/04-Defining-vs-Calling-a-function/README.es.md similarity index 98% rename from exercises/05-Defining-vs-Calling-a-function/README.es.md rename to exercises/04-Defining-vs-Calling-a-function/README.es.md index 0df4059..2095bcf 100644 --- a/exercises/05-Defining-vs-Calling-a-function/README.es.md +++ b/exercises/04-Defining-vs-Calling-a-function/README.es.md @@ -1,4 +1,4 @@ -# `05` Defining vs Calling a Function +# `04` Defining vs Calling a Function Las funciones solo existen si tú u otra persona las define... es la única forma en que el compilador/intérprete de lenguaje sabe que existen, por lo tanto, puede ejecutarlas cuando las llamas. diff --git a/exercises/05-Defining-vs-Calling-a-function/README.md b/exercises/04-Defining-vs-Calling-a-function/README.md similarity index 98% rename from exercises/05-Defining-vs-Calling-a-function/README.md rename to exercises/04-Defining-vs-Calling-a-function/README.md index 4d059b5..11b4567 100755 --- a/exercises/05-Defining-vs-Calling-a-function/README.md +++ b/exercises/04-Defining-vs-Calling-a-function/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=fz4ttmwZWuc" --- -# `05` Defining vs Calling a Function +# `04` Defining vs Calling a Function Functions will only exist if you or somebody else defines them; it is the only way the language compiler/interpreter knows they exist, therefore it's able to run them when you call them. diff --git a/exercises/05-Defining-vs-Calling-a-function/app.py b/exercises/04-Defining-vs-Calling-a-function/app.py similarity index 100% rename from exercises/05-Defining-vs-Calling-a-function/app.py rename to exercises/04-Defining-vs-Calling-a-function/app.py diff --git a/exercises/05-Defining-vs-Calling-a-function/solution.hide.py b/exercises/04-Defining-vs-Calling-a-function/solution.hide.py similarity index 100% rename from exercises/05-Defining-vs-Calling-a-function/solution.hide.py rename to exercises/04-Defining-vs-Calling-a-function/solution.hide.py diff --git a/exercises/05-Defining-vs-Calling-a-function/tests.py b/exercises/04-Defining-vs-Calling-a-function/tests.py similarity index 100% rename from exercises/05-Defining-vs-Calling-a-function/tests.py rename to exercises/04-Defining-vs-Calling-a-function/tests.py diff --git a/exercises/06-lambda-functions/README.es.md b/exercises/05-lambda-functions/README.es.md similarity index 97% rename from exercises/06-lambda-functions/README.es.md rename to exercises/05-lambda-functions/README.es.md index 40dcd34..9db503e 100644 --- a/exercises/06-lambda-functions/README.es.md +++ b/exercises/05-lambda-functions/README.es.md @@ -1,4 +1,4 @@ -# `06` Lambda Functions in Python +# `05` Lambda Functions in Python Una **función lambda** es una función con solo una línea de código y sin nombre. diff --git a/exercises/06-lambda-functions/README.md b/exercises/05-lambda-functions/README.md similarity index 97% rename from exercises/06-lambda-functions/README.md rename to exercises/05-lambda-functions/README.md index 771ef04..fbd20e8 100755 --- a/exercises/06-lambda-functions/README.md +++ b/exercises/05-lambda-functions/README.md @@ -3,7 +3,7 @@ tutorial: "https://www.youtube.com/watch?v=HACQ9uerCuE" --- -# `06` Lambda Functions in Python +# `05` Lambda Functions in Python A **lambda function** is a function with just one line of code and no name. diff --git a/exercises/06-lambda-functions/app.py b/exercises/05-lambda-functions/app.py similarity index 100% rename from exercises/06-lambda-functions/app.py rename to exercises/05-lambda-functions/app.py diff --git a/exercises/06-lambda-functions/solution.hide.py b/exercises/05-lambda-functions/solution.hide.py similarity index 100% rename from exercises/06-lambda-functions/solution.hide.py rename to exercises/05-lambda-functions/solution.hide.py diff --git a/exercises/06-lambda-functions/tests.py b/exercises/05-lambda-functions/tests.py similarity index 100% rename from exercises/06-lambda-functions/tests.py rename to exercises/05-lambda-functions/tests.py diff --git a/exercises/07-lambda-function-two/README.es.md b/exercises/06-lambda-function-two/README.es.md similarity index 95% rename from exercises/07-lambda-function-two/README.es.md rename to exercises/06-lambda-function-two/README.es.md index c85e631..f1b61f9 100644 --- a/exercises/07-lambda-function-two/README.es.md +++ b/exercises/06-lambda-function-two/README.es.md @@ -1,4 +1,4 @@ -# `07` Lambda Functions +# `06` Lambda Functions ### ☝ Recuerda: diff --git a/exercises/07-lambda-function-two/README.md b/exercises/06-lambda-function-two/README.md similarity index 95% rename from exercises/07-lambda-function-two/README.md rename to exercises/06-lambda-function-two/README.md index 8796c77..45e54a9 100755 --- a/exercises/07-lambda-function-two/README.md +++ b/exercises/06-lambda-function-two/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" --- -# `07` Lambda Functions +# `06` Lambda Functions ### ☝ Remember: diff --git a/exercises/07-lambda-function-two/app.py b/exercises/06-lambda-function-two/app.py similarity index 100% rename from exercises/07-lambda-function-two/app.py rename to exercises/06-lambda-function-two/app.py diff --git a/exercises/07-lambda-function-two/solution.hide.py b/exercises/06-lambda-function-two/solution.hide.py similarity index 100% rename from exercises/07-lambda-function-two/solution.hide.py rename to exercises/06-lambda-function-two/solution.hide.py diff --git a/exercises/07-lambda-function-two/tests.py b/exercises/06-lambda-function-two/tests.py similarity index 100% rename from exercises/07-lambda-function-two/tests.py rename to exercises/06-lambda-function-two/tests.py diff --git a/exercises/08-Function-that-returns/README.es.md b/exercises/07-Function-that-returns/README.es.md similarity index 96% rename from exercises/08-Function-that-returns/README.es.md rename to exercises/07-Function-that-returns/README.es.md index add2e88..086c4eb 100644 --- a/exercises/08-Function-that-returns/README.es.md +++ b/exercises/07-Function-that-returns/README.es.md @@ -1,4 +1,4 @@ -# `08` Functions that return +# `07` Functions that return Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None`. diff --git a/exercises/08-Function-that-returns/README.md b/exercises/07-Function-that-returns/README.md similarity index 96% rename from exercises/08-Function-that-returns/README.md rename to exercises/07-Function-that-returns/README.md index 1f4a6d7..01d7d9c 100755 --- a/exercises/08-Function-that-returns/README.md +++ b/exercises/07-Function-that-returns/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=-tqNmngh1PE" --- -# `08` Functions that return +# `07` Functions that return It is very good practice that all functions return something, even if it is `None`. diff --git a/exercises/08-Function-that-returns/app.py b/exercises/07-Function-that-returns/app.py similarity index 100% rename from exercises/08-Function-that-returns/app.py rename to exercises/07-Function-that-returns/app.py diff --git a/exercises/08-Function-that-returns/solution.hide.py b/exercises/07-Function-that-returns/solution.hide.py similarity index 100% rename from exercises/08-Function-that-returns/solution.hide.py rename to exercises/07-Function-that-returns/solution.hide.py diff --git a/exercises/08-Function-that-returns/test.py b/exercises/07-Function-that-returns/test.py similarity index 100% rename from exercises/08-Function-that-returns/test.py rename to exercises/07-Function-that-returns/test.py diff --git a/exercises/09-Function-parameters/README.es.md b/exercises/08-Function-parameters/README.es.md similarity index 96% rename from exercises/09-Function-parameters/README.es.md rename to exercises/08-Function-parameters/README.es.md index ca03d09..1f81497 100644 --- a/exercises/09-Function-parameters/README.es.md +++ b/exercises/08-Function-parameters/README.es.md @@ -1,4 +1,4 @@ -# `09` Function parameters +# `08` Function parameters Puedes especificar tantos parámetros como desees en una función. diff --git a/exercises/09-Function-parameters/README.md b/exercises/08-Function-parameters/README.md similarity index 96% rename from exercises/09-Function-parameters/README.md rename to exercises/08-Function-parameters/README.md index d8a4321..6ad2d14 100755 --- a/exercises/09-Function-parameters/README.md +++ b/exercises/08-Function-parameters/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=uaiDxW4LJNA" --- -# `09` Function parameters +# `08` Function parameters You can specify as many parameters as you want in a function. diff --git a/exercises/09-Function-parameters/app.py b/exercises/08-Function-parameters/app.py similarity index 100% rename from exercises/09-Function-parameters/app.py rename to exercises/08-Function-parameters/app.py diff --git a/exercises/09-Function-parameters/solution.hide.py b/exercises/08-Function-parameters/solution.hide.py similarity index 100% rename from exercises/09-Function-parameters/solution.hide.py rename to exercises/08-Function-parameters/solution.hide.py diff --git a/exercises/09-Function-parameters/tests.py b/exercises/08-Function-parameters/tests.py similarity index 100% rename from exercises/09-Function-parameters/tests.py rename to exercises/08-Function-parameters/tests.py diff --git a/exercises/10-Array-Methods/README.es.md b/exercises/09-Array-Methods/README.es.md similarity index 95% rename from exercises/10-Array-Methods/README.es.md rename to exercises/09-Array-Methods/README.es.md index 1c2810b..033cec3 100644 --- a/exercises/10-Array-Methods/README.es.md +++ b/exercises/09-Array-Methods/README.es.md @@ -1,4 +1,4 @@ -# `10` List Methods +# `09` List Methods ## 📝 Instrucciones: diff --git a/exercises/10-Array-Methods/README.md b/exercises/09-Array-Methods/README.md similarity index 95% rename from exercises/10-Array-Methods/README.md rename to exercises/09-Array-Methods/README.md index 69316e3..c3568b0 100755 --- a/exercises/10-Array-Methods/README.md +++ b/exercises/09-Array-Methods/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" --- -# `10` List Methods +# `09` List Methods ## 📝 Instructions: diff --git a/exercises/10-Array-Methods/app.py b/exercises/09-Array-Methods/app.py similarity index 100% rename from exercises/10-Array-Methods/app.py rename to exercises/09-Array-Methods/app.py diff --git a/exercises/10-Array-Methods/solution.hide.py b/exercises/09-Array-Methods/solution.hide.py similarity index 100% rename from exercises/10-Array-Methods/solution.hide.py rename to exercises/09-Array-Methods/solution.hide.py diff --git a/exercises/10-Array-Methods/tests.py b/exercises/09-Array-Methods/tests.py similarity index 100% rename from exercises/10-Array-Methods/tests.py rename to exercises/09-Array-Methods/tests.py From 3f0fa1e06f39cd81df41829f5c1b1883fc1bcdc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:23:32 -0500 Subject: [PATCH 163/165] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3c87dfd..8c084e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,7 @@ "extensions": ["learn-pack.learnpack-vscode"] } }, - "onCreateCommand": "pip3 install pytest==6.2.5 pytest-testdox mock && npm i @learnpack/learnpack@2.1.20 -g && learnpack plugins:install @learnpack/python@1.0.0" + "onCreateCommand": "pip3 install pytest==6.2.5 pytest-testdox mock && npm i @learnpack/learnpack@2.1.35 -g && learnpack plugins:install @learnpack/python@1.0.0" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, From 54198176b298d1ee9e82c25a8a0bfbf9fdb9a633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:24:45 -0500 Subject: [PATCH 164/165] Update learn.json --- learn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learn.json b/learn.json index 4786842..130bb24 100644 --- a/learn.json +++ b/learn.json @@ -19,7 +19,7 @@ "graded": true, "editor": { - "version": "1.0.73" + "version": "3.1.9" } } From dfaa8efeb4b37c4db25d47dd2a02cd078df4f872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charly=20Chac=C3=B3n?= <107764250+Charlytoc@users.noreply.github.com> Date: Wed, 13 Mar 2024 02:15:05 +0000 Subject: [PATCH 165/165] ADding videos --- exercises/00-Welcome/README.es.md | 3 +++ exercises/00-Welcome/README.md | 2 +- exercises/01-Hello-World/README.es.md | 4 ++++ exercises/01-Hello-World/README.md | 2 +- exercises/02-What-is-a-function/README.es.md | 3 +++ exercises/02-What-is-a-function/README.md | 2 +- exercises/03-Call-a-function/README.es.md | 2 +- exercises/03-Call-a-function/README.md | 2 +- exercises/04-Defining-vs-Calling-a-function/README.es.md | 4 ++++ exercises/04-Defining-vs-Calling-a-function/README.md | 2 +- exercises/05-lambda-functions/README.es.md | 4 ++++ exercises/05-lambda-functions/README.md | 2 +- exercises/06-lambda-function-two/README.es.md | 4 ++++ exercises/06-lambda-function-two/README.md | 2 +- exercises/07-Function-that-returns/README.es.md | 4 ++++ exercises/07-Function-that-returns/README.md | 2 +- exercises/08-Function-parameters/README.es.md | 4 ++++ exercises/08-Function-parameters/README.md | 2 +- exercises/09-Array-Methods/README.es.md | 4 ++++ exercises/09-Array-Methods/README.md | 2 +- 20 files changed, 45 insertions(+), 11 deletions(-) diff --git a/exercises/00-Welcome/README.es.md b/exercises/00-Welcome/README.es.md index 82f48a5..a2964b0 100644 --- a/exercises/00-Welcome/README.es.md +++ b/exercises/00-Welcome/README.es.md @@ -1,3 +1,6 @@ +--- +intro: "https://www.youtube.com/watch?v=SD9lqR67yMY" +--- # Welcome to Python Functions! ¡¡Nos entusiasma mucho tenerte aquí!! 🎉 😂 diff --git a/exercises/00-Welcome/README.md b/exercises/00-Welcome/README.md index 5522b4b..4b14bc8 100644 --- a/exercises/00-Welcome/README.md +++ b/exercises/00-Welcome/README.md @@ -1,5 +1,5 @@ --- -intro: "https://www.youtube.com/watch?v=awa_yfGgy9s" +intro: "https://www.youtube.com/watch?v=06rxSj-9wM4" --- # Welcome to Python Functions! diff --git a/exercises/01-Hello-World/README.es.md b/exercises/01-Hello-World/README.es.md index da0ecf5..bafbb75 100644 --- a/exercises/01-Hello-World/README.es.md +++ b/exercises/01-Hello-World/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=X1XZ4d-DE4Q" +--- + # `01` Hello World En Python, usamos **print** para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un string dado, etc.) en algo llamado "la consola". diff --git a/exercises/01-Hello-World/README.md b/exercises/01-Hello-World/README.md index cd5ba73..943c535 100644 --- a/exercises/01-Hello-World/README.md +++ b/exercises/01-Hello-World/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=voBO7a0KPtE" +tutorial: "https://www.youtube.com/watch?v=_0zvPIS587w" --- # `01` Hello World diff --git a/exercises/02-What-is-a-function/README.es.md b/exercises/02-What-is-a-function/README.es.md index bf34887..6fe4214 100644 --- a/exercises/02-What-is-a-function/README.es.md +++ b/exercises/02-What-is-a-function/README.es.md @@ -1,3 +1,6 @@ +--- +tutorial: "https://www.youtube.com/watch?v=4JzHH2qR8n0" +--- # `02` What is a function? Puedes ver una función como un **fragmento de código** que puedes usar varias veces. diff --git a/exercises/02-What-is-a-function/README.md b/exercises/02-What-is-a-function/README.md index 5bd1324..24569d2 100755 --- a/exercises/02-What-is-a-function/README.md +++ b/exercises/02-What-is-a-function/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=tgTLyZ0cKj4" +tutorial: "https://www.youtube.com/watch?v=U5GId8yOc-A" --- # `02` What is a function? diff --git a/exercises/03-Call-a-function/README.es.md b/exercises/03-Call-a-function/README.es.md index a81e346..8748075 100644 --- a/exercises/03-Call-a-function/README.es.md +++ b/exercises/03-Call-a-function/README.es.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" +tutorial: "https://www.youtube.com/watch?v=F7_I8PD38ZQ" --- # `03` Calling a Function diff --git a/exercises/03-Call-a-function/README.md b/exercises/03-Call-a-function/README.md index 7e1d9f5..07ce82d 100755 --- a/exercises/03-Call-a-function/README.md +++ b/exercises/03-Call-a-function/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=NU5iW_bWwmY" +tutorial: "https://www.youtube.com/watch?v=8tvkCp3EMiM" --- # `03` Calling a Function diff --git a/exercises/04-Defining-vs-Calling-a-function/README.es.md b/exercises/04-Defining-vs-Calling-a-function/README.es.md index 2095bcf..9f2d53f 100644 --- a/exercises/04-Defining-vs-Calling-a-function/README.es.md +++ b/exercises/04-Defining-vs-Calling-a-function/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=ztyFrIY7U3o" +--- + # `04` Defining vs Calling a Function Las funciones solo existen si tú u otra persona las define... es la única forma en que el compilador/intérprete de lenguaje sabe que existen, por lo tanto, puede ejecutarlas cuando las llamas. diff --git a/exercises/04-Defining-vs-Calling-a-function/README.md b/exercises/04-Defining-vs-Calling-a-function/README.md index 11b4567..ea048df 100755 --- a/exercises/04-Defining-vs-Calling-a-function/README.md +++ b/exercises/04-Defining-vs-Calling-a-function/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=fz4ttmwZWuc" +tutorial: "https://www.youtube.com/watch?v=XbDE19gR678" --- # `04` Defining vs Calling a Function diff --git a/exercises/05-lambda-functions/README.es.md b/exercises/05-lambda-functions/README.es.md index 9db503e..8298707 100644 --- a/exercises/05-lambda-functions/README.es.md +++ b/exercises/05-lambda-functions/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=UH__beyfTlo" +--- + # `05` Lambda Functions in Python Una **función lambda** es una función con solo una línea de código y sin nombre. diff --git a/exercises/05-lambda-functions/README.md b/exercises/05-lambda-functions/README.md index fbd20e8..6ce4581 100755 --- a/exercises/05-lambda-functions/README.md +++ b/exercises/05-lambda-functions/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=HACQ9uerCuE" +tutorial: "https://www.youtube.com/watch?v=vRusUCDa3-k" --- diff --git a/exercises/06-lambda-function-two/README.es.md b/exercises/06-lambda-function-two/README.es.md index f1b61f9..fc990cb 100644 --- a/exercises/06-lambda-function-two/README.es.md +++ b/exercises/06-lambda-function-two/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=F30Vkf69SHI" +--- + # `06` Lambda Functions ### ☝ Recuerda: diff --git a/exercises/06-lambda-function-two/README.md b/exercises/06-lambda-function-two/README.md index 45e54a9..c293196 100755 --- a/exercises/06-lambda-function-two/README.md +++ b/exercises/06-lambda-function-two/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=1HwmTkQPeMo" +tutorial: "https://www.youtube.com/watch?v=0KX8Bh7d_9E" --- # `06` Lambda Functions diff --git a/exercises/07-Function-that-returns/README.es.md b/exercises/07-Function-that-returns/README.es.md index 086c4eb..80bd645 100644 --- a/exercises/07-Function-that-returns/README.es.md +++ b/exercises/07-Function-that-returns/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=3V15moFzUjI" +--- + # `07` Functions that return Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None`. diff --git a/exercises/07-Function-that-returns/README.md b/exercises/07-Function-that-returns/README.md index 01d7d9c..0103d2d 100755 --- a/exercises/07-Function-that-returns/README.md +++ b/exercises/07-Function-that-returns/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=-tqNmngh1PE" +tutorial: "https://www.youtube.com/watch?v=H6Zps4dPqzs" --- # `07` Functions that return diff --git a/exercises/08-Function-parameters/README.es.md b/exercises/08-Function-parameters/README.es.md index 1f81497..a9b4992 100644 --- a/exercises/08-Function-parameters/README.es.md +++ b/exercises/08-Function-parameters/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=LuA-x5DYPr4" +--- + # `08` Function parameters Puedes especificar tantos parámetros como desees en una función. diff --git a/exercises/08-Function-parameters/README.md b/exercises/08-Function-parameters/README.md index 6ad2d14..86e9167 100755 --- a/exercises/08-Function-parameters/README.md +++ b/exercises/08-Function-parameters/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=uaiDxW4LJNA" +tutorial: "https://www.youtube.com/watch?v=BCMQF44H-BY" --- # `08` Function parameters diff --git a/exercises/09-Array-Methods/README.es.md b/exercises/09-Array-Methods/README.es.md index 033cec3..16712e8 100644 --- a/exercises/09-Array-Methods/README.es.md +++ b/exercises/09-Array-Methods/README.es.md @@ -1,3 +1,7 @@ +--- +tutorial: "https://www.youtube.com/watch?v=Ne8ZRZTSaQA" +--- + # `09` List Methods ## 📝 Instrucciones: diff --git a/exercises/09-Array-Methods/README.md b/exercises/09-Array-Methods/README.md index c3568b0..b5812cd 100755 --- a/exercises/09-Array-Methods/README.md +++ b/exercises/09-Array-Methods/README.md @@ -1,5 +1,5 @@ --- -tutorial: "https://www.youtube.com/watch?v=jBXve_vh7dU" +tutorial: "https://www.youtube.com/watch?v=5Wk2a16nnUY" --- # `09` List Methods