Skip to content

Ejercicios practicados #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
5 done out of 45
  • Loading branch information
danderi committed Dec 10, 2024
commit 1882f4797836d4f2efec702aeb65e7deaafac6c2
8 changes: 8 additions & 0 deletions .learn/resets/002-sum_of_three_numbers/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Sum all three input numbers and print on the console the result
first_number = int(input("First input: "))
second_number = int(input("Second input: "))
third_number = int(input("Third input: "))


# Print here the sum of all three inputs
print(first_number+second_number)
7 changes: 7 additions & 0 deletions .learn/resets/003-area_of_right_triangle/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the area of a triangle
def area_of_triangle(base, height):
# Your code here, please remove the "None"
return None

# Testing your function
print(area_of_triangle(3, 5))
7 changes: 7 additions & 0 deletions .learn/resets/004-hello_harry/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function below to print the output as per the example
def hello_name(name):
# Your code here
return None

# Invoke the function with your name as the function's argument
print(hello_name("Bob"))
8 changes: 8 additions & 0 deletions .learn/resets/005-previous_and_next/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Complete the function to return the previous and next number of a given number
def previous_next(num):
# Your code here
return None


# Invoke the function with any integer as its argument
print(previous_next(179))
6 changes: 6 additions & 0 deletions .learn/resets/006-apple_sharing/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def apple_sharing(n,k):
# Your code here
return None


print(apple_sharing(6,50))
2 changes: 1 addition & 1 deletion exercises/002-sum_of_three_numbers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@


# Print here the sum of all three inputs
print(first_number+second_number)
print(first_number+second_number+third_number)
2 changes: 1 addition & 1 deletion exercises/003-area_of_right_triangle/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complete the function to return the area of a triangle
def area_of_triangle(base, height):
# Your code here, please remove the "None"
return None
return base * height / 2

# Testing your function
print(area_of_triangle(3, 5))
2 changes: 1 addition & 1 deletion exercises/004-hello_harry/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complete the function below to print the output as per the example
def hello_name(name):
# Your code here
return None
return f"Hello, {name}!"

# Invoke the function with your name as the function's argument
print(hello_name("Bob"))
2 changes: 1 addition & 1 deletion exercises/005-previous_and_next/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complete the function to return the previous and next number of a given number
def previous_next(num):
# Your code here
return None
return (num-1, num+1)


# Invoke the function with any integer as its argument
Expand Down