Skip to content

Instantly share code, notes, and snippets.

@camckin10
camckin10 / practicePython.py
Last active April 1, 2019 16:25
Programming Exercises--to add to repo
QUESTION #6--
Create a program that determines how many years you have left until retirement and the year you can retire. It should prompt for your current age and the age you want to retire and display the output as shown in the example that follows.
Example Output
What is your current age? 25
At what age would you like to retire? 65
You have 40 years left until you can retire.
It's 2015, so you can retire in 2055.
Constraints
• Again, be sure to convert the input to numerical data before doing any math.
• Don’t hard-code the current year into your program. Get it from the system time via your programming lan- guage.
@camckin10
camckin10 / warmup1.py
Last active January 8, 2019 17:06
WarmUp Exercises from CodingBat Python(Python3)
#EXERCISE #1
#diff21--Given an int n, return the absolute difference between n and 21, except return double the absolute difference if
#n is over 21.
#first solution try--only got 1 out of 12 correct
def diff21(n):
if n < 21:
return n *2
else:
return n - 21
@camckin10
camckin10 / emaildrills.js
Last active July 19, 2017 00:00
emaildrills.js
JS Exercises sent by Anna(Thinkful) through email 7-13-17
PRACTICE THE FOLLOWING:
FUNCTION EXERCISES
1) Take this array, carData and write a function
that returns the highest value of the property of year:
2) THEN write a function that returns all the models,
in Uppercase and sorts them. --alphabetically?
@camckin10
camckin10 / eventdrills.js
Last active August 10, 2017 01:48
Event Drills
//Session Questions
//discuss difference between function and event? I am thinking they can be used interchangeably
//event.current.target vs. this
//when the console is not printing anything, what is going on??
//
1. cat carousel
function thumbnailClicks() {
$('.thumbnail').click(function(event){//selecting thumbnail from html,and making an event
var image=$(event.current.target).find('img').attr('src');//creating a variable that will make current target an event.
@camckin10
camckin10 / displayexerciseproject
Created April 13, 2017 01:42
displayexerciseproject
//Display exercise project HTML
<!DOCTYPE html>
<html>
<head>
<title>CSS Layout Exercises | display property</title>
<meta charset="utf-8" name="description" content="Layout exercise on `display` property for Thinkful's front end web development course">
<!-- fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
@camckin10
camckin10 / arraydrills.js
Last active February 21, 2019 00:10
arraydrills.js
1.) Creating arrays
//function with 3 arguments, item1,item2,item3
//return three items as an array
function makeList(item1,item2,item3) {
return [item1,item2,item3];
}
2.) Adding array items
//function called addToList that accepts an array and an item as arguments, and returns the
//array with the item added to the end. Function will have side effect of changing original array.
@camckin10
camckin10 / challengequestion.js
Created April 4, 2017 23:21
Frequent Word Challenge question answer
Challenge Question Answer
function getTokens(rawString) {
// NB: `.filter(Boolean)` removes any falsy items from an array
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort();
}
/returning a lowercase string which will be
/.split = split takes this expression and splits array based on character in
parenthesis
if character in parenthesis is not in original array, then array will return
original array
@camckin10
camckin10 / CSSDrillspart2
Last active March 27, 2017 19:36
Target Practice CSS Drills prt 2
1.) To complete the drill for element selectors below, you'll need to target section elements and h1 elements. Specifically:
Write one ruleset for sections that gives them a bottom margin of 90px
Write one ruleset for header elements that sets font-family to Helvetica.
HTML:
<main>
<section>
<header>
<h1>Really important section header</h1>
@camckin10
camckin10 / CSSDrills
Last active March 22, 2017 00:39
CSS Drills
1.) Drill 1: Width, Height, Color, Border
In this drill, you’ll add classes to the two divs to create a blue box and a red box, as described in the code comments and paragraphs in the code pen. To complete this drill, you'll need to use the following CSS properties:
background-color
margin-bottom
border
SOLUTION:
html
<main>
1.) Link Here, Link There
<main>
<h2>1. Open this Link THERE!</h2>
<p><a href = "#" target="https://www.stackoverflow.com">Stack Overflow </a></p>
--> Replace this text with a link that links to the Stack Overflow website and opens in a new tab.
<h2>2. Click a link to send email!</h2>
<p> <a href= "mailto:username@site.org?subject=link%20here%20link%20there%20linkhere,linkthere">Blank Email</a></p>
</main>
---> Replace the text in this paragraph that opens a blank email with the subject line, link here, link there