One thing I learned today in Ruby 01

To get into the ruby program you type in “irb” into the command prompt.

To calculate an exponent in ruby to type two asterisk signs like: 4**2 = 16

Part of the development environment  ruby is MySQL apparently and we also use this cool Command line emulator called the Cmder (Commander).

One thing I learned today in Python 02

With the .split() function you can split a list of values separated by a separating character into its individual constituent parts. For example, if you have a list of: ‘bks,swhc,rmbs’ you can add the spit function to it ‘bks,swhc,rmbs’.split() and it will separate the list into ‘bks’,’swhc’,’rmbs’. You can also tell the split function to separate the items by any character like a :, *, -, and not just commas.

If you have a string, you can create a place holder in it that you can change with the .format(). For example, the string “Giant glutes {} like a pair of {}”.format(‘smell’,’balls’) will print out Giant glutes smell like a pair of balls. And “Giant glutes {} like a pair of {}”.format(‘massive’,’sluts’) print ‘Giant glutes massive like a pair of sluts’.

One thing I learned today in Python 01

In Python is you add .1+.1+.1-.3 the result is not zero but instead 5.551115123125783e-17 which is a number that has 16 zeros after the decimal. In other words, an infinitesimally small number equal to zero.

Also, when doing arithmetic on a variable to save time you can simply use the “operation = sign” convention to avoid having to write the variable twice. For example, if I create the variable: week and set it equal to 7, if I want to multiply week times 2 and assign that new value to the week variable I can simply write: week *= 2 and that is the same as writing: week = week * 2. Which is a great time saver.