Monday 21 October 2019

Python - Day Eleven (October)

WHAT I DID TODAY / LEARNED:


Today I finished the 'Taking a Vacation' lesson. Except it wasn't really a lesson, I believe it's more of a review that wanted me to incorporate the skills I learned to calculate the costs of going on a 'vacation.' I did not learn anything new today and instead will just be explaining what I did.




35% OF THE COURSE COMPLETED


I will kind of be going through step by step of the review I did because I figured since I didn't learn anything today, I should be giving a more thorough explanation.




  • The first step I was told to do was to define the cost of hotels. I used the def function and return to calculate the cost of the hotel based on the number of days I'll be staying.

STEP 1: HOTEL COST



  • The second step was to calculate the plane cost ride using the def function, return, and elif. Based on the city I choose at the end, that will be how much the plane cost would be.
STEP 2: CHOOSING CITIES

  • The third step was to calculate car rental costs. I used the def function, if function, elif, and return. I also had to use different 'math' codes like == or >= because I was told to add 'discounts' based on the costs.
STEP 3: CAR RENTAL


  • The fourth step was just adding everything together. As you can see in the def trip_cost on line 22. I added all the other 'steps' together to get the total cost. After that on line 25, I printed out the actual trip cost. (I also chose the city Los Angeles, the cost changes based on what I choose)
STEP 4: FINAL STEP IS ADDING EVERYTHING TOGETHER


Basically this 'vacation' unit was just a review on the few codes such as return, elif, def etc; (if it wasn't already obvious.)




WHAT I WILL BE DOING TOMORROW / NEXT TIME:





Next time I will be doing the unit named 'Python Lists and Dictionaries.' I can't say much as I don't really know much about it either but here is a description of what it is about.


MY NEXT UNIT
There are 14 lessons in this specific unit, so I'm not sure if I will have enough time to be able to just go through half, or all of it.

No comments:

Post a Comment

Adobe Photoshop - Day 10 (June Final Post)

WHAT I DID TODAY / WHAT I LEARNED: For my final project, I thought for a while about what I could do. Then I remembered a while back I saw ...