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