Wednesday, May 30, 2018

Python Fundamentals Part 1

This past weeks assignment allowed me to expolore and implement some of the basic functions of Python. I was tasked with creating a single script that took my full name and eventually broke it down in to how many characters were in my last name times 3.

My script looked something like this.:

>>> fullname='Joshua Eide Touchstone'
>>> listname= fullname.split(' ')
>>> lastnamelength=len(listname[2])
>>> triplelastname=lastnamelength*3
>>> Touchstone= triplelastname
>>> Touchstone
30
--------------------------------------------------------------------------------------------------------------
Some of the notes that I took throughout the lab that appeared as if I would need them again in the future:

1.       Pressing enter twice will run a prompt and all other lines involved. You could also hold ctrl then press enter instead of typing “if”.
2.       When doing division with numbers you must include the decimal amount. Such as 10.0/3.0
3.       When trying to split last name use lastname.split(‘ ‘)= (‘Joshua’,’Eide’,’Touchstone), from there you can isolate certain values. Joshua would be 0 and Touchstone would be 2.
4.       Must specify what the variable is before it can be used. Variables will be what stores information.

5.       List can store sequence values. Can consist of strings or numbers
-------------------------------------------------------------------------------------------------------------------
              
             Overall, this week was challenging. It was my first real introduction to coding. I know it was a simple task but it was a great learning experience and I am looking forward to becoming better at this whole programming thing. 

No comments:

Post a Comment

Module 7: Working with Rasters

This assignment was much more simple to me than our last previous few. It was more straightforward and I only struggled at the end. We wer...