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..23ffa5c 100644 --- a/exercises/01-Hello-World/app.py +++ b/exercises/01-Hello-World/app.py @@ -1 +1,2 @@ # Your code here +print("hello world") \ No newline at end of file diff --git a/exercises/02-What-is-a-function/app.py b/exercises/02-What-is-a-function/app.py index efeec63..a313431 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..22ae660 100755 --- a/exercises/03-Call-a-function/app.py +++ b/exercises/03-Call-a-function/app.py @@ -2,3 +2,10 @@ 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) + +print(square_area1) +print(square_area2) +print(square_area3) \ No newline at end of file diff --git a/exercises/04-Defining-vs-Calling-a-function/app.py b/exercises/04-Defining-vs-Calling-a-function/app.py index eedeae6..7982226 100755 --- a/exercises/04-Defining-vs-Calling-a-function/app.py +++ b/exercises/04-Defining-vs-Calling-a-function/app.py @@ -1,4 +1,7 @@ # 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..aa4f199 100755 --- a/exercises/05-lambda-functions/app.py +++ b/exercises/05-lambda-functions/app.py @@ -1,2 +1,4 @@ # Your function here +is_odd = lambda num: num%2 !=0 +print(is_odd(3)) \ No newline at end of file diff --git a/exercises/06-lambda-function-two/app.py b/exercises/06-lambda-function-two/app.py index a156102..002cb8c 100755 --- a/exercises/06-lambda-function-two/app.py +++ b/exercises/06-lambda-function-two/app.py @@ -1,5 +1,4 @@ - - +rapid = lambda n: n[:-1] # Your code above, please do not change code below print(rapid("bob")) # Should print "bo" diff --git a/exercises/07-Function-that-returns/app.py b/exercises/07-Function-that-returns/app.py index fc81947..1e98f84 100755 --- a/exercises/07-Function-that-returns/app.py +++ b/exercises/07-Function-that-returns/app.py @@ -5,3 +5,7 @@ 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) \ No newline at end of file diff --git a/exercises/08-Function-parameters/app.py b/exercises/08-Function-parameters/app.py index 71294e0..10740b6 100755 --- a/exercises/08-Function-parameters/app.py +++ b/exercises/08-Function-parameters/app.py @@ -1,6 +1,6 @@ # Your code goes here: -def render_person(param): - return param +def render_person(name, birthay, color, age, gender): + return f"{name} is a {age} years old {gender} born in {birthay} 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..a4a178a 100755 --- a/exercises/09-Array-Methods/app.py +++ b/exercises/09-Array-Methods/app.py @@ -1,6 +1,9 @@ names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] ## CREATE YOUR FUNCTION HERE - +def sort_names(array): + return sorted(array) + print(sort_names(names)) +