Python Forum
Trying to teach myself how to code and I'm stuck on a question I found online...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to teach myself how to code and I'm stuck on a question I found online...
#2
You are adjusting the annual_salary, but when you do so you need to recalculate the values based on annual_salary (monthly_salary and monthly_saved). Generally changing a value in Python does not change other values based on the first value. This isn't a hard and fast rule, as certain operations with mutable objects (including lists, dictionarys, sets, and user define objects) can be affected. But for immutable objects (including ints, floats, strings, and tuples) changing the value of a variable has no effect on previous calculations based on that variable.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Trying to teach myself how to code and I'm stuck on a question I found online... - by ichabod801 - Dec-16-2018, 01:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I found how many numbers are there in a Collatz Sequence that I found? cananb 5 3,889 Nov-23-2020, 05:15 PM
Last Post: cananb
  Need help with this code and am stuck TheBoonester 2 2,373 Sep-19-2019, 07:56 PM
Last Post: j.crater
  I have homework that I've made no effort to show any code that I'm stuck on Ronaldinho 1 2,429 May-30-2019, 07:18 PM
Last Post: nilamo
  stuck in a block of code fadi 1 2,961 Aug-26-2017, 02:26 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020