Skip to content

Commit 7176d16

Browse files
committed
Done until excercise 15
1 parent 21347af commit 7176d16

File tree

16 files changed

+71
-12
lines changed

16 files changed

+71
-12
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def two_timestamp(hr1, min1, sec1, hr2, min2, sec2):
2+
# Your code here
3+
return None
4+
5+
6+
# Invoke the function and pass two timestamps(6 intergers) as its arguments
7+
print(two_timestamp(1,1,1,2,2,2))

.learn/resets/009-two_digits/app.py

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 tens digit and the units digit of any interger
2+
def two_digits(number):
3+
# Your code here
4+
return None
5+
6+
7+
# Invoke the function with any two digit integer as its argument
8+
print(two_digits(79))

.learn/resets/010-swap_digits/app.py

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 swapped digits of a given two-digit integer
2+
def swap_digits(num):
3+
# Your code here
4+
return None
5+
6+
# Invoke the function with any two-digit integer as its argument
7+
print(swap_digits(30))
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Complete the function to print the last two digits of an integer greater than 9
2+
def last_two_digits(num):
3+
return None
4+
5+
# Invoke the function with any integer greater than 9
6+
print(last_two_digits())

.learn/resets/012-tens_digit/app.py

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 tens digit of a given integer
2+
def tens_digit(num):
3+
return None
4+
5+
6+
# Invoke the function with any integer
7+
print(tens_digit())
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Complete the function "digits_sum" so that it prints the sum of a three-digit number
2+
def digits_sum(num):
3+
return None
4+
5+
6+
# Invoke the function with any three-digit number
7+
print(digits_sum(123))
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 first digit to the right of the decimal point
2+
def first_digit(num):
3+
return None
4+
5+
6+
# Invoke the function with a positive real number. ex. 34.33
7+
print(first_digit())

.learn/resets/015-car_route/app.py

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 amount of days it will take to cover a route
2+
def car_route(n,m):
3+
return None
4+
5+
6+
# Invoke the function with two integers
7+
print(car_route())

exercises/008-two_timestamps/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def two_timestamp(hr1, min1, sec1, hr2, min2, sec2):
22
# Your code here
3-
return None
3+
return (hr2*3600)+(min2*60)+sec2 - (hr1*3600)-(min1*60)-sec1
44

55

66
# Invoke the function and pass two timestamps(6 intergers) as its arguments

exercises/009-two_digits/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 tens digit and the units digit of any interger
22
def two_digits(number):
33
# Your code here
4-
return None
4+
return (number//10, number%10)
55

66

77
# Invoke the function with any two digit integer as its argument

0 commit comments

Comments
 (0)