From 19d4e8295817788b8f7cd3eab655eee001532750 Mon Sep 17 00:00:00 2001 From: HeidyDB Date: Sun, 25 May 2025 16:02:41 +0000 Subject: [PATCH 1/2] Initial commit From 669f88b4d8300eb4131722d46c666c46f2640616 Mon Sep 17 00:00:00 2001 From: HeidyDB Date: Sun, 25 May 2025 16:02:41 +0000 Subject: [PATCH 2/2] Pending changes exported from your codespace --- .learn/resets/01-Hello-World/app.py | 1 + .learn/resets/02-What-is-a-function/app.py | 6 ++++++ .learn/resets/03-Call-a-function/app.py | 4 ++++ .learn/resets/04-Defining-vs-Calling-a-function/app.py | 5 +++++ .learn/resets/05-lambda-functions/app.py | 2 ++ .learn/resets/06-lambda-function-two/app.py | 5 +++++ .learn/resets/07-Function-that-returns/app.py | 7 +++++++ .learn/resets/08-Function-parameters/app.py | 7 +++++++ .learn/resets/09-Array-Methods/app.py | 6 ++++++ exercises/01-Hello-World/app.py | 1 + exercises/02-What-is-a-function/app.py | 4 ++-- exercises/03-Call-a-function/app.py | 3 +++ exercises/04-Defining-vs-Calling-a-function/app.py | 2 ++ exercises/05-lambda-functions/app.py | 2 +- exercises/06-lambda-function-two/app.py | 9 ++++++++- exercises/08-Function-parameters/app.py | 5 +++-- exercises/09-Array-Methods/app.py | 5 +++++ 17 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 .learn/resets/01-Hello-World/app.py create mode 100644 .learn/resets/02-What-is-a-function/app.py create mode 100644 .learn/resets/03-Call-a-function/app.py create mode 100644 .learn/resets/04-Defining-vs-Calling-a-function/app.py create mode 100644 .learn/resets/05-lambda-functions/app.py create mode 100644 .learn/resets/06-lambda-function-two/app.py create mode 100644 .learn/resets/07-Function-that-returns/app.py create mode 100644 .learn/resets/08-Function-parameters/app.py create mode 100644 .learn/resets/09-Array-Methods/app.py diff --git a/.learn/resets/01-Hello-World/app.py b/.learn/resets/01-Hello-World/app.py new file mode 100644 index 0000000..fce62c1 --- /dev/null +++ b/.learn/resets/01-Hello-World/app.py @@ -0,0 +1 @@ +# Your code here diff --git a/.learn/resets/02-What-is-a-function/app.py b/.learn/resets/02-What-is-a-function/app.py new file mode 100644 index 0000000..efeec63 --- /dev/null +++ b/.learn/resets/02-What-is-a-function/app.py @@ -0,0 +1,6 @@ +def sum(number1,number2): + return number1 + number2 + +# Your code here +total = sum(2,3) +print(total) diff --git a/.learn/resets/03-Call-a-function/app.py b/.learn/resets/03-Call-a-function/app.py new file mode 100644 index 0000000..0c131b3 --- /dev/null +++ b/.learn/resets/03-Call-a-function/app.py @@ -0,0 +1,4 @@ +def calculate_area(length, width): + return length * width + +# Your code below this line diff --git a/.learn/resets/04-Defining-vs-Calling-a-function/app.py b/.learn/resets/04-Defining-vs-Calling-a-function/app.py new file mode 100644 index 0000000..eedeae6 --- /dev/null +++ b/.learn/resets/04-Defining-vs-Calling-a-function/app.py @@ -0,0 +1,5 @@ +# Define below the function called "multi" that expects 2 parameters + +# Don't edit anything below this line +return_value = multi(7,53812212) +print(return_value) diff --git a/.learn/resets/05-lambda-functions/app.py b/.learn/resets/05-lambda-functions/app.py new file mode 100644 index 0000000..b4ac556 --- /dev/null +++ b/.learn/resets/05-lambda-functions/app.py @@ -0,0 +1,2 @@ +# Your function here + diff --git a/.learn/resets/06-lambda-function-two/app.py b/.learn/resets/06-lambda-function-two/app.py new file mode 100644 index 0000000..a156102 --- /dev/null +++ b/.learn/resets/06-lambda-function-two/app.py @@ -0,0 +1,5 @@ + + + +# Your code above, please do not change code below +print(rapid("bob")) # Should print "bo" diff --git a/.learn/resets/07-Function-that-returns/app.py b/.learn/resets/07-Function-that-returns/app.py new file mode 100644 index 0000000..fc81947 --- /dev/null +++ b/.learn/resets/07-Function-that-returns/app.py @@ -0,0 +1,7 @@ +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 ↓ ####### diff --git a/.learn/resets/08-Function-parameters/app.py b/.learn/resets/08-Function-parameters/app.py new file mode 100644 index 0000000..71294e0 --- /dev/null +++ b/.learn/resets/08-Function-parameters/app.py @@ -0,0 +1,7 @@ +# Your code goes here: +def render_person(param): + return param + + +# Do not edit below this line +print(render_person('Bob', '05/22/1983', 'green', 23, 'male')) \ No newline at end of file diff --git a/.learn/resets/09-Array-Methods/app.py b/.learn/resets/09-Array-Methods/app.py new file mode 100644 index 0000000..9d60f6b --- /dev/null +++ b/.learn/resets/09-Array-Methods/app.py @@ -0,0 +1,6 @@ +names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] + +## CREATE YOUR FUNCTION HERE + + +print(sort_names(names)) diff --git a/exercises/01-Hello-World/app.py b/exercises/01-Hello-World/app.py index fce62c1..0ec004e 100644 --- a/exercises/01-Hello-World/app.py +++ b/exercises/01-Hello-World/app.py @@ -1 +1,2 @@ # Your code here +print("Hello World") diff --git a/exercises/02-What-is-a-function/app.py b/exercises/02-What-is-a-function/app.py index efeec63..8523d65 100755 --- a/exercises/02-What-is-a-function/app.py +++ b/exercises/02-What-is-a-function/app.py @@ -2,5 +2,5 @@ def sum(number1,number2): return number1 + number2 # Your code here -total = sum(2,3) -print(total) +super_duper = sum(3445324 ,53454423) +print(super_duper) diff --git a/exercises/03-Call-a-function/app.py b/exercises/03-Call-a-function/app.py index 0c131b3..758b6e6 100755 --- a/exercises/03-Call-a-function/app.py +++ b/exercises/03-Call-a-function/app.py @@ -2,3 +2,6 @@ def calculate_area(length, width): return length * width # Your code below this line +square_area1 = calculate_area(4,4) +square_area2 = calculate_area(2,2) +square_area3 = calculate_area(5,5) diff --git a/exercises/04-Defining-vs-Calling-a-function/app.py b/exercises/04-Defining-vs-Calling-a-function/app.py index eedeae6..2292ec3 100755 --- a/exercises/04-Defining-vs-Calling-a-function/app.py +++ b/exercises/04-Defining-vs-Calling-a-function/app.py @@ -1,4 +1,6 @@ # Define below the function called "multi" that expects 2 parameters +def multi(a,b): + return a*b # Don't edit anything below this line return_value = multi(7,53812212) diff --git a/exercises/05-lambda-functions/app.py b/exercises/05-lambda-functions/app.py index b4ac556..2455c9d 100755 --- a/exercises/05-lambda-functions/app.py +++ b/exercises/05-lambda-functions/app.py @@ -1,2 +1,2 @@ # Your function here - +is_odd =lambda num: num % 2 != 0 diff --git a/exercises/06-lambda-function-two/app.py b/exercises/06-lambda-function-two/app.py index a156102..2171c42 100755 --- a/exercises/06-lambda-function-two/app.py +++ b/exercises/06-lambda-function-two/app.py @@ -1,5 +1,12 @@ - +rapid = lambda stringP: stringP[:-1] # Your code above, please do not change code below print(rapid("bob")) # Should print "bo" + + +''' + +Create a lambda function called rapid, which will take one string parameter. + +Return the same string with the last letter removed.''' diff --git a/exercises/08-Function-parameters/app.py b/exercises/08-Function-parameters/app.py index 71294e0..75d78ae 100755 --- a/exercises/08-Function-parameters/app.py +++ b/exercises/08-Function-parameters/app.py @@ -1,6 +1,7 @@ # Your code goes here: -def render_person(param): - return param +def render_person(name, date, color, age, gender): + + return name + " is a " + str(age) + " years old " + gender + " born in " + date + " with " + color+ " eyes" # Do not edit below this line diff --git a/exercises/09-Array-Methods/app.py b/exercises/09-Array-Methods/app.py index 9d60f6b..1d38ccd 100755 --- a/exercises/09-Array-Methods/app.py +++ b/exercises/09-Array-Methods/app.py @@ -1,6 +1,11 @@ names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] ## CREATE YOUR FUNCTION HERE +def sort_names(names): + ordenada= sorted(names) + return ordenada + + print(sort_names(names))