Self Reflection for April 26

Throughout these past weeks, I believe I did great, but I was discussing conversations with my peers which could make it seem like I wasn’t working, but I actually got to 42% which was way past my 35% goal.

Throughout these percents on Ruby, I’ve been learning the basics of Ruby (similar to Python) and how they work. One major thing I learned is that Python only uses print while Ruby uses both print and puts which is different to Python. The difference between print and puts is that puts prints the text then puts the equivalence to pressing enter. For example:

puts "There will be a space between me and the next line"
print "See "

Will turn into:

There will be a space between me and the next line
See nil

The other thing I noticed as I was working through Ruby is that after all code it says “nil” which basically means the end of the code or it represents nothingness according to this website: https://goo.gl/LikSSP .

Another thing I learned is how to loop through arrays which is different from Python:

a = [1, 2, 3, 4 , 5]

for number in a:
     print number

returns with:
1
2
3
4
5

It’s like this in Ruby:

numbers = [1, 2, 3, 4, 5]

numbers.each { |number| puts number}

returns with:

1
2
3
4
5

which is quite different from Python but gives the same results. Although it doesn’t look hard it’s still confusing to memorize and remember to do array_name.each { |element| puts/print element }.

Overall I learned quite a bit over these weeks even though we had the spring break.

My old goal was too easy than what I expected but that may be because Ruby has fewer lessons that Python did, so my next goal is to get from 42% to around 65%.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *