diff --git a/exercises/02-Hello-World/app.py b/exercises/02-Hello-World/app.py index 801de24..a7b3217 100644 --- a/exercises/02-Hello-World/app.py +++ b/exercises/02-Hello-World/app.py @@ -1 +1,2 @@ -# your code here \ No newline at end of file +# your code here +print("Hello World") \ No newline at end of file diff --git a/exercises/03-What-is-a-function/app.py b/exercises/03-What-is-a-function/app.py index 551610b..39daa3a 100755 --- a/exercises/03-What-is-a-function/app.py +++ b/exercises/03-What-is-a-function/app.py @@ -5,7 +5,8 @@ def sum(number1,number2): print(total) - +super_duper = sum(3445324,53454423) +print(super_duper) diff --git a/exercises/04-Call-a-function/app.py b/exercises/04-Call-a-function/app.py index c856d48..935d79a 100755 --- a/exercises/04-Call-a-function/app.py +++ b/exercises/04-Call-a-function/app.py @@ -1,4 +1,14 @@ def calculate_area(length,edge): return length * edge -# Your code Below this line: \ No newline at end of file +# Your code Below this line: +square_area1 = calculate_area(4,4) +print (square_area1) + +square_area2 = calculate_area(2,2) +print(square_area2) + +square_area3 = calculate_area(5,5) +print(square_area3) + + diff --git a/exercises/05-Defining-vs-Calling-a-function/app.py b/exercises/05-Defining-vs-Calling-a-function/app.py index 79b86d8..7b562c9 100755 --- a/exercises/05-Defining-vs-Calling-a-function/app.py +++ b/exercises/05-Defining-vs-Calling-a-function/app.py @@ -1,5 +1,6 @@ # Define 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) print(return_value) \ No newline at end of file diff --git a/exercises/06-lambda-functions/app.py b/exercises/06-lambda-functions/app.py index e59626e..1c3f267 100755 --- a/exercises/06-lambda-functions/app.py +++ b/exercises/06-lambda-functions/app.py @@ -1,2 +1,9 @@ # your function here +# this function return True if a number is odd. +# def is_odd(num): +# return (num % 2)! == 0: + +is_odd = lambda num: (num % 2)!= 0 + +print(is_odd) \ No newline at end of file diff --git a/exercises/07-lambda-function-two/app.py b/exercises/07-lambda-function-two/app.py index fca265d..9cc2405 100755 --- a/exercises/07-lambda-function-two/app.py +++ b/exercises/07-lambda-function-two/app.py @@ -1,4 +1,4 @@ - +rapid = lambda string: string[:-1] # From this line above, plese do not change code below diff --git a/exercises/08-Function-that-returns/app.py b/exercises/08-Function-that-returns/app.py index 44ab611..6522599 100755 --- a/exercises/08-Function-that-returns/app.py +++ b/exercises/08-Function-that-returns/app.py @@ -4,4 +4,8 @@ def dollar_to_euro(dollar_value): def euro_to_yen(euro_value): return euro_value * 124.15 -####### ↓ YOUR CODE BELOW ↓ ####### \ No newline at end of file +####### ↓ YOUR CODE BELOW ↓ ####### +dollar1euro = dollar_to_euro(137) + +euro1yen = euro_to_yen(dollar1euro) +print(str(euro1yen)) \ No newline at end of file diff --git a/exercises/09-Function-parameters/app.py b/exercises/09-Function-parameters/app.py index 71294e0..b0d293d 100755 --- a/exercises/09-Function-parameters/app.py +++ b/exercises/09-Function-parameters/app.py @@ -1,6 +1,8 @@ # Your code goes here: -def render_person(param): - return param +def render_person(name,date,color,age,gender): + concat = name +" "+ "is a"+" "+str(age)+" "+ "years old" +" "+ gender+" "+"born in"+" "+date +" "+ "with" +" "+ color +" "+ "eyes" + return concat + # Do not edit below this line diff --git a/exercises/10-Array-Methods/app.py b/exercises/10-Array-Methods/app.py index fdddc23..039e702 100755 --- a/exercises/10-Array-Methods/app.py +++ b/exercises/10-Array-Methods/app.py @@ -1,5 +1,7 @@ names = ['John', 'Kenny', 'Tom', 'Bob', 'Dilan'] ## CREATE YOUR FUNCTION HERE +def sort_names(order): + return sorted(order) print(sort_names(names))