Skip to content

Commit 1882f47

Browse files
committed
5 done out of 45
1 parent fca4706 commit 1882f47

File tree

9 files changed

+40
-4
lines changed

9 files changed

+40
-4
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Sum all three input numbers and print on the console the result
2+
first_number = int(input("First input: "))
3+
second_number = int(input("Second input: "))
4+
third_number = int(input("Third input: "))
5+
6+
7+
# Print here the sum of all three inputs
8+
print(first_number+second_number)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Complete the function to return the area of a triangle
2+
def area_of_triangle(base, height):
3+
# Your code here, please remove the "None"
4+
return None
5+
6+
# Testing your function
7+
print(area_of_triangle(3, 5))

.learn/resets/004-hello_harry/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Complete the function below to print the output as per the example
2+
def hello_name(name):
3+
# Your code here
4+
return None
5+
6+
# Invoke the function with your name as the function's argument
7+
print(hello_name("Bob"))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Complete the function to return the previous and next number of a given number
2+
def previous_next(num):
3+
# Your code here
4+
return None
5+
6+
7+
# Invoke the function with any integer as its argument
8+
print(previous_next(179))
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def apple_sharing(n,k):
2+
# Your code here
3+
return None
4+
5+
6+
print(apple_sharing(6,50))

exercises/002-sum_of_three_numbers/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66

77
# Print here the sum of all three inputs
8-
print(first_number+second_number)
8+
print(first_number+second_number+third_number)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Complete the function to return the area of a triangle
22
def area_of_triangle(base, height):
33
# Your code here, please remove the "None"
4-
return None
4+
return base * height / 2
55

66
# Testing your function
77
print(area_of_triangle(3, 5))

exercises/004-hello_harry/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Complete the function below to print the output as per the example
22
def hello_name(name):
33
# Your code here
4-
return None
4+
return f"Hello, {name}!"
55

66
# Invoke the function with your name as the function's argument
77
print(hello_name("Bob"))

exercises/005-previous_and_next/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Complete the function to return the previous and next number of a given number
22
def previous_next(num):
33
# Your code here
4-
return None
4+
return (num-1, num+1)
55

66

77
# Invoke the function with any integer as its argument

0 commit comments

Comments
 (0)