File tree Expand file tree Collapse file tree 9 files changed +40
-4
lines changed
003-area_of_right_triangle
003-area_of_right_triangle Expand file tree Collapse file tree 9 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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 ))
Original file line number Diff line number Diff line change 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" ))
Original file line number Diff line number Diff line change 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 ))
Original file line number Diff line number Diff line change 1+ def apple_sharing (n ,k ):
2+ # Your code here
3+ return None
4+
5+
6+ print (apple_sharing (6 ,50 ))
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 11# Complete the function to return the area of a triangle
22def 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
77print (area_of_triangle (3 , 5 ))
Original file line number Diff line number Diff line change 11# Complete the function below to print the output as per the example
22def 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
77print (hello_name ("Bob" ))
Original file line number Diff line number Diff line change 11# Complete the function to return the previous and next number of a given number
22def 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
You can’t perform that action at this time.
0 commit comments