Post Reply 
HP Prime: a student's view
08-31-2021, 04:06 PM (This post was last modified: 08-31-2021 04:09 PM by Thomas_Sch.)
Post: #15
RE: HP Prime: a student's view
(08-31-2021 03:41 PM)toml_12953 Wrote:  Although it works the same in this particular case, in general, this isn't the same as
Code:
while True
# do something
if r0<=0:
  exit

Why? Suppose r0 =-4 when the code reaches the while statement. What will your loop do? What will mine do?

Yours isn't executed at all if r0 <=0. The example from the website and my example will execute the loop at least once.

Many thanks, this is correct.

Did you find out why your results are so different?
("I only get 17,340.68 ...")
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime: a student's view - Liam Hays - 08-30-2021, 01:11 AM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 01:30 AM
RE: HP Prime: a student's view - Thomas_Sch - 08-31-2021 04:06 PM
RE: HP Prime: a student's view - parisse - 08-31-2021, 07:30 PM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 11:20 PM
RE: HP Prime: a student's view - jte - 09-01-2021, 10:43 PM
RE: HP Prime: a student's view - Liam Hays - 09-03-2021, 01:31 AM
RE: HP Prime: a student's view - jte - 09-05-2021, 03:44 PM
RE: HP Prime: a student's view - jte - 09-05-2021, 06:16 AM
RE: HP Prime: a student's view - pinkman - 09-03-2021, 09:30 PM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 01:30 AM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 04:49 PM
RE: HP Prime: a student's view - ijabbott - 09-04-2021, 08:44 AM



User(s) browsing this thread: 1 Guest(s)