Created
January 18, 2017 22:24
-
-
Save dmmfll/3c2c0c5fab70058905ad82d3de1f2939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Untitled.* | |
.ipynb_checkpoints/ | |
gist_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = (0..25).to_a.zip(("a".."z").to_a) | |
Hash[data] | |
keys = ["first", "last"] | |
names = [ | |
["don", "morehouse"], | |
["skye", "aniko"], | |
["bianco", "monaco"] | |
] | |
full_names = names.map do |name| | |
Hash[keys.zip(name)] | |
end | |
puts full_names | |
p ("a".."z").to_a.index 1 | |
[[2, 1]][0][1] | |
(0..25).each do |i| | |
puts i if i.odd? | |
end | |
{a: 1, b: 2, c: 3, d: "cat"}.each do |k, v| | |
puts k.class | |
puts v.class | |
end | |
def puts_me(x) | |
puts x # return is nil | |
end | |
p puts_me('hello') | |
puts puts_me('hello') | |
def puts_me(x) | |
x # return is x | |
end | |
p puts_me('hello') | |
puts puts_me('hello') | |
result = (1...26).step(2).map do |x| | |
x | |
end | |
p result | |
result = (0...26).each do |x| | |
puts x.odd? | |
end | |
p result | |
puts 2 ** 0.5 | |
i = 0 | |
while i <= 25 | |
puts i.odd? | |
i += 1 | |
end | |
def element_index(element, my_array) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment