Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Saturday, December 1, 2012
Codecademy: Comprehending Comprehensions
#sample solution
threes_and_fives = [x for x in range(16)[1::] if (x%3==0) or (x%5==0)]
print threes_and_fives
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
This is an example of
scrolling text
using Javascript.
Popular Posts
Compounding: Finding the Present Value of an Annuity
A typical compounding problem would be something like: How much is the equivalent Present Value (P) if an investment pays an amount (A...
Codecademy: String Rotation
// Sample solution // Write a string rotation method. // It should pass all the tests given below. String.prototype.rotate = function(n...
Codecademy Sample Solution: Codeyear Get to the back of the line!
<style> span { background-image: url('http://hosturl.co.uk/cc/lady2.png'); width: 105px; heig...
Math Problems: Finding a Product
Script solution for finding a product problem: Answer: 30 console.log("----------------------------------"); function som...
Compounding: Finding the Annuity given its Present Value
A typical compounding problem would be something like: How much will I get annually (A) starting next year if I invest a present value...
Math Problem: Cutting a Plane with X Lines
Question: What is the maximum number of regions a plane can be cut into by an X number of lines Answer: number of regions = 0.5 * ( x^2 + ...
Array Element Tally
Say you had an election, and you needed to tally the votes for each candidate. All you need to do is enter the name of each candidate o...
Codecademy: "Word Up"
#sample solution pyg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): p...
Compounding: Finding the Future Value given the Present Value
A typical compounding problem would be something like: What is the future value (F) of a present value (P) deposited/lent at an intere...
Codecademy: Inheritance Syntax
#sample solution class Shape(object): """Makes shapes!""" def __init__(self, number_of_sides): self....
No comments:
Post a Comment