WSQ 13 – Cars

--Originally published at Programming

Instructions: Write a program that opens and reads the file 93cars.dat.txt and produces the following data:

  • average gas mileage in city (City MPG)
  • average gas mileage on highway (Highway MPG)
  • average midrange price of the vehicles in the set.

Data from: Journal of Statistics Education.

Code:

Captura de pantalla 2017-05-04 a la(s) 15.49.08

Data:

Captura de pantalla 2017-05-04 a la(s) 15.53.16.png

How it runs:

Captura de pantalla 2017-05-04 a la(s) 15.48.57

 

Mastery topics: Reading and writing of text files


Last blog from this course!

--Originally published at Programming

Hola, para terminar este curso hice un video recordando las cosas que me han gustado y probablemente las que no de este curso de fundamentos de la programación. Probablemente no dije todo lo que podríamos destacar del curso, pero recordé las cosas más importantes para mí.

A decir verdad, me costó mucho grabar esto porque creo que soy algo tímida, he incluso ahora siento algo de nervios al compartirlo, pero estoy bien con esto.

Video: https://www.youtube.com/watch?v=Vw9TXirysNk&t=16s

Por último, quiero hacer un agradecimiento a mi compañero Hector, que me ha ayudado mucho cuando tengo dudas y además a veces haciamos algunos códigos juntos. Pueden visitar su blog haciendo clic en su nombre.

 


Technology, more than a selfie.

--Originally published at Programming

Hello everyone. Maybe someday someone who is not so related to technology will be reading this.

This is a new world for me, but I have been discovering some things. The field of development is very broad, so here I will leave some links about the areas that I have liked until today:

Artificial intelligence

Aeronautics: NASA

Clean energies

Network security

 

 


Just let’s talk

--Originally published at Programming

Hola a todos, este será un blog súper diferente a los anteriores.

Hoy quisiera sólo hablar un poco de mi experiencia con la tecnología, porque hace un año jamás imagine tener un blog acerca de nada, pero muchísimo menos acerca de programación.

Me gustaría hablar acerca de esto, para que si de casualidad alguien que entienda español y lea esto, pueda sentirse identificado se de cuenta que no es le fin del mundo.

Todo empezó cuando estaba en el penúltimo semestre de preparatoria y debía empezar a pensar acerca de una carrera. Bien, no tenía ni idea, porque me gusta mucho el arte, pero siento que no tengo el talento suficiente para poder vivir de eso. Y no quiero que suene mal, realmente me siento bien así.

Pero otra de las cosas que más me gustan es la la ciencia, así que me aventure un poco por ese rumbo. Debo decir que aún no estoy segura de mi elección, pero me siento cómoda con este ambiente.

Sin embargo, sufrí un fuerte cambio de interés. Es lo que quiero compartir hoy. Creo que todos tenemos derecho de cambiar y no por eso significa que perdamos nuestra escencia. Actualmente, no sé qué rumbo tomará mi vida porque nunca había pensado en desarrollarme en este ambiente. Pero puedo decirles que darme la oportunidad de conocer todas estas cosas nuevas me hace sentir bien, y creo que también estoy disfrutando mucho el momento sin importar qué venga después.

Entonces quiero decirles que aunque a veces no podamos definirnos con certeza a nosotros mismos, creo que eso puede ser tomado como un mundo de posibilidades frente a nuestro camino. No debemos tener miedo de explorar no sólo el mundo, sino también nuestro interior.


WSQ 08 – Yo soy 196

--Originally published at Programming

Instructions: Check the values (that the user gives you) from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately.

Code:

Captura de pantalla 2017-05-02 a la(s) 20.44.37

It runs like:

Captura de pantalla 2017-05-02 a la(s) 20.45.20


WSQ09 – Multipart Data and Files Files

--Originally published at Programming

Instructions: Create a function that receives as parameter the name of a file (this would be a string value like data.txt).

Look at the example of how we save it:

Captura de pantalla 2017-05-02 a la(s) 20.28.26

Instructions: your function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values).

Here is the code:

Captura de pantalla 2017-05-02 a la(s) 20.36.24

See how here we return a tuple. Python can return just single thing, so… we made like a package of some thing, but it still being just one.

It runs like this:

Captura de pantalla 2017-05-02 a la(s) 20.36.16

 


Quiz 11 – part II

--Originally published at Programming

Hello! This is the second part of this quiz because the first time I made this blog I skip some exercises. One of them was on the real exam (yes, so sad). Well, I just going to talk about the last problem (number 10), because number 8 (Babylonian method) and 9 (Go Bananas) are in Quiz 14 – Exam.

Instructions: Write a function called gcd that receives to positive integers and returns the greatest  common divisor of them (the largest integer that divides both of the parameters evenly).

Code:

Captura de pantalla 2017-04-27 a la(s) 13.31.03

How it runs:

Captura de pantalla 2017-04-27 a la(s) 13.30.52

 

Hope it helps ?


Quiz 14 – Exam

--Originally published at Programming

Hello everybody.

Today we have questions to practice for the exam. It’s similar to my blog quiz 11, but now complete.

Exercises

We have already done the first part:

1.- See question 2 from Quiz 11 ?

2.- See question 4 from Quiz 11 ?

3.- See question 5 from Quiz 11 ?

4.- Go to Quiz 08 ?

This is new:

5.- Babylonian method

This is like WSQ10, but we can review it again here.

Instructions: Write a function to calculate the square root of a number x using the Babylonian method, it receives a single parameter: the number x and returns the value of the square root of x when two successive estimates differ only by 0.0001 (or less).

Code:

Captura de pantalla 2017-04-27 a la(s) 13.43.32

It runs like:

Captura de pantalla 2017-04-27 a la(s) 13.43.59

 

6.- Bananas

This is like WSQ11, but we can review it again here.

Instructions: Write a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana” is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two). Create your own test file (plain text) to check your work.

Code:

Captura de pantalla 2017-04-27 a la(s) 13.17.14

How it runs:

Captura de pantalla 2017-04-27 a la(s) 13.18.15

 

 

 


WSQ 11 – Go Bananas

--Originally published at Programming

Hello everyone

For this week assigment we have to: Write a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana”  (or “BANANA” ) is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two).

Here is the code:

Captura de pantalla 2017-04-27 a la(s) 13.17.14

And this is how it runs:

Captura de pantalla 2017-04-27 a la(s) 13.18.15