Hello! My name is Rick and I am in search for gig as a developer :)
This past December I finished up a year long study with a full-stack school in NYC called Codeimmersives. We explored HTML, CSS, JavaScript, and how to build applications using the MERN stack. I learned about class-based components, passing props around (prop-drilling) and utilizing the component lifecycle(componentWillMount, componentDidMount, etc). After learning class based components, we moved on to functional based components using hooks, custom hooks, and different ways to manage state, such as the useContext and Redux APIs. (This is just a brief overview of the technologies I studied over the past year). Currently I am enrolled at devCodeCamp learning Python and solving problems. I am documenting my journey by sharing these blog posts. Please help me out by dropping a comment below on what you think!
Today was a good day. I had plenty of rest the night before and hit the gym first thing in the morning. From 10am - 6pm I solved problems in python (with the exception of an hour for lunch and a few small breaks here and there). It really helps to sleep and exercise; it felt like I was amped up all day long!
Below is my work :)
def find_indices(list, target):
for i in range(0,len(list)):
for j in range(i,len(list)):
if list[i] + list[j] == target:
return [i,j]
print(find_indices([2,3,4,22,4,6], 28))
def recip_reverse(num):
num = str(num)
num = num[::-1]
num = 1/int(num)
num = "{:.5f}".format(num)
return num
print(recip_reverse(17))
def to_str(char):
return str(char)
def how_many_turns(current_lock, target_lock):
current_lock = str(current_lock)
target_lock = str(target_lock)
count = 0
for i in range(0,len(current_lock)):
if current_lock[i] == target_lock[i]:
continue
num1 = int(current_lock[i])
num2 = int(target_lock[i])
if num1 < num2:
count += num2 - num1
else:
count += (num2 + 10) - num1
return count
print(how_many_turns(3893, 5296))
def can_sort_by_increments(list_of_nums):
list_of_nums.sort()
for i in range(1,len(list_of_nums)):
num1 = list_of_nums[i - 1]
num2 = list_of_nums[i]
if num2 != num1 + 1:
return False
return True
print(can_sort_by_increments([5, 7, 3, 8, 6]))
def pos_and_neg_num(list_of_nums):
pos_count = 0
neg_sum = 0
for num in list_of_nums:
if num < 0:
neg_sum += num
elif num > 0:
pos_count += 1
return [pos_count, neg_sum]
print(pos_and_neg_num([7, 9, -3, -32, 107, -1, 36, 95, -14, -99, 21]))
def highest_lowest_num(string):
list_of_nums = string.split(' ')
for i in range(0, len(list_of_nums)):
list_of_nums[i] = int(list_of_nums[i])
print(list_of_nums)
max_num = str(max(list_of_nums))
min_num = str(min(list_of_nums))
return f'{min_num} {max_num}'
print(highest_lowest_num("3 9 0 1 4 8 10 2"))
def is_valid_email(str):
has_dot = False
has_at_sym = False
for char in str:
if char == '.':
has_dot = True
elif char == '@':
has_at_sym = True
if has_dot and has_at_sym:
return True
else:
return False
print(is_valid_email('gmail.com'))
def alpha_to_pos(string):
alpha = '1abcdefghijklmnopqrstuvwxyx'
alpha = list(alpha)
new_str = ''
for char in string:
new_str = new_str + (str(alpha.index(char)) + ' ')
return new_str
print(alpha_to_pos('hello'))
from audioop import reverse
from datetime import date
next_twenty_leap_years = []
def next_twenty_leap_years():
current_year = int(date.today().strftime("%Y"))
for i in range(0, 20):
if current_year % 4 == 0:
print('Leap Year ==>', current_year)
current_year += 1
next_twenty_leap_years()
def longest_palindromic_substring(string, num = 2, longest_found = ''):
position1 = 0
position2 = num
while position2 <= len(string):
sub_str = string[position1:position2]
if sub_str == sub_str[::-1]:
if len(sub_str) >= len(longest_found):
longest_found = sub_str
position1 += 1
position2 += 1
if position1 == 1 and position2 == (len(string)) :
return longest_found
num += 1
return longest_palindromic_substring(string, num, longest_found)
print(longest_palindromic_substring('forgeeksskeegfor'))
import math
def hours_and_minutes(seconds):
if seconds < 1:
return 'Please input a number that can be evaluated larger than 0!'
hours = 0
minutes = 0
if seconds > 3600:
hours = math.floor(seconds/3600)
seconds = (seconds - hours * 3600)
minutes = math.floor(seconds/60)
seconds = (seconds - minutes * 60)
elif seconds < 3600 and seconds > 60:
minutes = math.floor(seconds/60)
seconds = (seconds - minutes * 60)
return f'The seconds in question are equal to {hours} hours, {minutes} minutes, and {seconds} seconds!'
print(hours_and_minutes(20520))
def abs_diff(num):
difference = 13 - num
if num > 13:
difference = difference * 2
return abs(difference)
print(abs_diff(-2))
def compare_last_digit(num1, num2, num3):
num1 = str(num1)
num2 = str(num2)
num3 = str(num3)
num1 = num1[len(num1)-1]
num2 = num2[len(num2)-1]
num3 = num3[len(num3)-1]
if num1 == num2 and num1 == num3:
return 'All three of these numbers have the same right most digit'
elif num1 == num2 or num1 == num3 or num2 == num3:
return 'Two of these numbers have the same right most digit'
else:
return 'None of these numbers have the same right most digit'
print(compare_last_digit(23,31,456))
def is_dist_of_three_ab(string):
contains_a = string.__contains__('a')
contains_b = string.__contains__('b')
if contains_a and contains_b:
index1 = string.find('b')
index2 = string.find('a')
distance = abs(index1 - index2)
if distance == 3:
return True
else: return False
return False
print('dist between a and b 3? ====>', is_dist_of_three_ab('jollyas bee'))
def is_p_and_t_equal_count(string):
string = string.lower()
count_p = 0
count_t = 0
for char in string:
if char in string == 'p':
count_p += 1
elif char == 't':
count_t += 1
if count_p == count_t:
return True
else: return False
print('p and t count same? ====>',is_p_and_t_equal_count('hgsd nbvs thngtt nbfppk p'))
def add_all_digits(num):
result = 0
num = str(num)
for digit in num:
result += int(digit)
return result
print(add_all_digits(1232))