Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kwaku Boateng bkwaku

🎯
Focusing
View GitHub Profile
View porting.rb
require 'net/http'
require 'date'
require 'logger'
require 'socket'
begin
require 'openssl'
BaseSSLError = OpenSSL::SSL::SSLError
View activity_5.py
my_list = [(7,9),(8,10),(13,17)]
def check_free_time(my_list):
free_time = []
my_list.sort()
if my_list[0][0] > 0: #if the first meeting is not at midnight
t = (0, my_list[0][0])
free_time.append(t)
View activity_4.py
def ascending_order(my_list):
length_list = len(my_list) - 1
sorted = False
while not sorted:
sorted = True
for i in range(length_list):
if my_list[i][1] > my_list[i+1][1]:
sorted = False
my_list[i], my_list[i+1] = my_list[i+1], my_list[i]
return my_list
View activity_3.py
my_list = [3,5,4,8,3,2,1,6,11]
#todo
#implement ascending order here
def ascending_order(my_list):
length_list = len(my_list) - 1
sorted = False
while not sorted:
sorted = True
for i in range(length_list):