Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Thursday, December 22, 2016
Codefights def simpleSort(arr)
#sample solution
def simpleSort(arr):
n = len(arr)
for i in range(n):
j = 0
stop = n - i
while j < stop - 1:
if arr[j] > arr[j + 1]:
temp = arr[j+1]
arr[j+1] = arr[j]
arr[j] = temp
j += 1
return arr
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
Codecademy Sample Solution: Conditional Assignment
favorite_animal ||= "dog" favorite_animal ||= "cat"
Codecademy: "Function and Control Flow"
//sample solution def isEven(x): if(x % 2 == 0): return "yep" else: return "nope"
Codeschool Sample Solution Selecting Direct Children
$("#tours > li")
Make a Website: HTML Wrap with a div
<!-- Sample solution to index.html --> <!DOCTYPE html> <html> <body> <div class="nav"> ...
Codecademy: "Splat!"
#sample solution def favorite_actors(*actors): """Prints out your favorite actorS (plural!)""" pr...
What hotkeys can you use in a Python shell to repeat the previous command you typed?
Answer: Alt - p p stands for previous. If you keep pressing Alt - p, you will continue cycling back through commands you typed before. I...
Codecademy: The sum of scores
#sample solution grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5] def grade_sum(grades): sum = 0 for grade in gra...
Codecademy Sample Solution: Codeyear Show 'em where to go
<DOCTYPE! html> <html> <head> <link rel="text/javascript" href="script.js" /> ...
Codeschool Sample Solution Changing Text
$("span").text("$100")
Codeschool Sample Solution Keyup Event Handler I
$(document).ready(function() { $("#nights").on("keyup", function() { $("#nights-count").text($(this)...
No comments:
Post a Comment