Python Forum
Trouble with LPtHW exercise 21
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with LPtHW exercise 21
#7
(Sep-09-2017, 04:50 PM)ichabod801 Wrote: No. age = add(30, 5) calls the add function with the parameters 30 and 5. The add function then prints 'Adding 30 + 5', and then adds 30 and 5 and returns the value 35. The value 35 is then assigned to the age variable, although it is perhaps more precise to say that the age label is attached to the value 35. Then in the big, stand alone print statement, the age value is used. The age variable is not called. It is an integer, and integers are not callable. It is just used to reference the value 35, which is then put in the string statement where the first %d is.

That was the way I wanted to explain it, but I guess I wasn't correct enough
Reply


Messages In This Thread
Trouble with LPtHW exercise 21 - by pyth31 - Sep-09-2017, 12:12 PM
RE: Trouble with LPtHW exercise 21 - by snippsat - Sep-09-2017, 12:28 PM
RE: Trouble with LPtHW exercise 21 - by ichabod801 - Sep-09-2017, 01:16 PM
RE: Trouble with LPtHW exercise 21 - by pyth31 - Sep-09-2017, 02:52 PM
RE: Trouble with LPtHW exercise 21 - by ichabod801 - Sep-09-2017, 04:50 PM
RE: Trouble with LPtHW exercise 21 - by pyth31 - Sep-09-2017, 07:46 PM
RE: Trouble with LPtHW exercise 21 - by Larz60+ - Sep-09-2017, 06:12 PM

Forum Jump:

User Panel Messages

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