Skip to content

Codespace cuddly computing machine g447x79q9xj7f9vx6 #73

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .learn/resets/001-hello_world/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
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))
5 changes: 5 additions & 0 deletions .learn/resets/006.1-square_value_of_number/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def square(num):
# Your code here
return None

print(square(6))
6 changes: 6 additions & 0 deletions .learn/resets/007-hours_and_minutes/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def hours_minutes(seconds):
# Your code here
return None

# Invoke the function and pass any integer as its argument
print(hours_minutes(3900))
7 changes: 7 additions & 0 deletions .learn/resets/008-two_timestamps/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def two_timestamp(hr1, min1, sec1, hr2, min2, sec2):
# Your code here
return None


# Invoke the function and pass two timestamps(6 intergers) as its arguments
print(two_timestamp(1,1,1,2,2,2))
8 changes: 8 additions & 0 deletions .learn/resets/009-two_digits/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Complete the function to return the tens digit and the units digit of any interger
def two_digits(number):
# Your code here
return None


# Invoke the function with any two digit integer as its argument
print(two_digits(79))
7 changes: 7 additions & 0 deletions .learn/resets/010-swap_digits/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the swapped digits of a given two-digit integer
def swap_digits(num):
# Your code here
return None

# Invoke the function with any two-digit integer as its argument
print(swap_digits(30))
6 changes: 6 additions & 0 deletions .learn/resets/011-last_two_digits/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Complete the function to print the last two digits of an integer greater than 9
def last_two_digits(num):
return None

# Invoke the function with any integer greater than 9
print(last_two_digits())
7 changes: 7 additions & 0 deletions .learn/resets/012-tens_digit/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the tens digit of a given integer
def tens_digit(num):
return None


# Invoke the function with any integer
print(tens_digit())
7 changes: 7 additions & 0 deletions .learn/resets/013-sum_of_digits/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function "digits_sum" so that it prints the sum of a three-digit number
def digits_sum(num):
return None


# Invoke the function with any three-digit number
print(digits_sum(123))
7 changes: 7 additions & 0 deletions .learn/resets/014-digit_after_decimal_point/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the first digit to the right of the decimal point
def first_digit(num):
return None


# Invoke the function with a positive real number. ex. 34.33
print(first_digit())
7 changes: 7 additions & 0 deletions .learn/resets/015-car_route/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the amount of days it will take to cover a route
def car_route(n,m):
return None


# Invoke the function with two integers
print(car_route())
7 changes: 7 additions & 0 deletions .learn/resets/016-century/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the respective number of the century
def century(year):
return None


# Invoke the function with any given year
print(century())
7 changes: 7 additions & 0 deletions .learn/resets/017-total_cost/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the total cost in dollars and cents of (n) cupcakes
def total_cost(d, c, n):
return None


# Invoke the function with three integers: total_cost(dollars, cents, number_of_cupcakes)
print(total_cost(15,22,4))
7 changes: 7 additions & 0 deletions .learn/resets/018-day_of_week/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complete the function to return the number of day of the week for k'th day of year
def day_of_week(k):
return None


# Invoke function day_of_week with an integer between 1 and 365
print(day_of_week())
6 changes: 6 additions & 0 deletions .learn/resets/019-digital_clock/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Complete the function to return how many hours and minutes are displayed on the 24h digital clock
def digital_clock(n):
return None

# Invoke the function with any integer (minutes after midnight)
print(digital_clock())
1 change: 1 addition & 0 deletions .learn/resets/020-factorial/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/021-square_root/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/022-Integral/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/023-list-and-tuple/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/024-class-with-two-methods/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/025-print-formula/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/026-two-dimensional-array/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/027-sequence-of-words/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/028-sequence-of-lines/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/029-remove-duplicate-words/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/030-divisable-binary/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/031-sum-eigth-digit/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/032-numbers-of-letters-and-digits/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/033-number-of-uppercase/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/034-a_aa_aaa_aaaa/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/035-square-each-odd-number/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/036-net-amount/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions .learn/resets/037-validity-of-password/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Your code here
1 change: 1 addition & 0 deletions exercises/001-hello_world/app.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Your code here
print("Hello World")
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 "Hello, " + name + "!"

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

return valor


# Invoke the function with any integer as its argument
Expand Down
4 changes: 3 additions & 1 deletion exercises/006-apple_sharing/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
def apple_sharing(n,k):
# Your code here
return None
result = k // n
resto = k % n
return result,resto


print(apple_sharing(6,50))
2 changes: 1 addition & 1 deletion exercises/006.1-square_value_of_number/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def square(num):
# Your code here
return None
return num ** 2

print(square(6))
6 changes: 5 additions & 1 deletion exercises/007-hours_and_minutes/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
def hours_minutes(seconds):
# Your code here
return None
horas = seconds // 3600
segundos_restantes = seconds % 3600
minutos = segundos_restantes // 60

return horas, minutos

# Invoke the function and pass any integer as its argument
print(hours_minutes(3900))
7 changes: 5 additions & 2 deletions exercises/008-two_timestamps/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
def two_timestamp(hr1, min1, sec1, hr2, min2, sec2):
# Your code here
return None
# Your code here
hora1 = hr1 * 3600 + min1 * 60 + sec1
hora2 = hr2 * 3600 + min2 * 60 + sec2
result = hora2 - hora1
return result


# Invoke the function and pass two timestamps(6 intergers) as its arguments
Expand Down
2 changes: 1 addition & 1 deletion exercises/009-two_digits/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complete the function to return the tens digit and the units digit of any interger
def two_digits(number):
# Your code here
return None
return (number // 10), (number % 10)


# Invoke the function with any two digit integer as its argument
Expand Down
3 changes: 2 additions & 1 deletion exercises/010-swap_digits/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Complete the function to return the swapped digits of a given two-digit integer
def swap_digits(num):
# Your code here
return None
result = str(num % 10 ) + str(num // 10)
return int(result)

# Invoke the function with any two-digit integer as its argument
print(swap_digits(30))
6 changes: 4 additions & 2 deletions exercises/011-last_two_digits/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Complete the function to print the last two digits of an integer greater than 9
def last_two_digits(num):
return None
if num > 9:
result = str(num)[-2:]
return int(result)

# Invoke the function with any integer greater than 9
print(last_two_digits())
print(last_two_digits(1149))
5 changes: 3 additions & 2 deletions exercises/012-tens_digit/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Complete the function to return the tens digit of a given integer
def tens_digit(num):
return None
result = str(num)[-2]
return int(result)


# Invoke the function with any integer
print(tens_digit())
print(tens_digit(179))
8 changes: 6 additions & 2 deletions exercises/013-sum_of_digits/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Complete the function "digits_sum" so that it prints the sum of a three-digit number
def digits_sum(num):
return None
result1 = 0
for i in range(3):
result = str(num)[i]
result1 = result1 + int(result)
return result1


# Invoke the function with any three-digit number
print(digits_sum(123))
print(digits_sum(789))
5 changes: 3 additions & 2 deletions exercises/014-digit_after_decimal_point/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Complete the function to return the first digit to the right of the decimal point
def first_digit(num):
return None

return int(str(num)[2])


# Invoke the function with a positive real number. ex. 34.33
print(first_digit())
print(first_digit(6.24))
7 changes: 5 additions & 2 deletions exercises/015-car_route/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Complete the function to return the amount of days it will take to cover a route
import math

def car_route(n,m):
return None
result = math.ceil (m / n)
return result


# Invoke the function with two integers
print(car_route())
print(car_route(30,90))
10 changes: 8 additions & 2 deletions exercises/016-century/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Complete the function to return the respective number of the century
import math
def century(year):
return None
if year % 100 == 0:
return (year // 100)
else:
return (year // 100 + 1)



# Invoke the function with any given year
print(century())
print(century(1500))

4 changes: 3 additions & 1 deletion exercises/017-total_cost/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Complete the function to return the total cost in dollars and cents of (n) cupcakes
def total_cost(d, c, n):
return None
valor1 = d * n
valor2 = c * n
return valor1, valor2


# Invoke the function with three integers: total_cost(dollars, cents, number_of_cupcakes)
Expand Down
4 changes: 2 additions & 2 deletions exercises/018-day_of_week/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complete the function to return the number of day of the week for k'th day of year
def day_of_week(k):
return None
return (3 + k) % 7


# Invoke function day_of_week with an integer between 1 and 365
print(day_of_week())
print(day_of_week(1))
8 changes: 6 additions & 2 deletions exercises/019-digital_clock/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Complete the function to return how many hours and minutes are displayed on the 24h digital clock
def digital_clock(n):
return None
horas = n // 60
minutos = n % 60

return horas, minutos

# Invoke the function with any integer (minutes after midnight)
print(digital_clock())
print(digital_clock(150))

Loading
Loading