Skip to content

Instantly share code, notes, and snippets.

View bkwaku's full-sized avatar
🎯
Focusing

Kwaku Boateng bkwaku

🎯
Focusing
View GitHub Profile
require 'net/http'
require 'date'
require 'logger'
require 'socket'
begin
require 'openssl'
BaseSSLError = OpenSSL::SSL::SSLError
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)
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
@bkwaku
bkwaku / activity_3.py
Created October 10, 2016 20:11
Class activity
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):