On Sunday, October 8, 2017 at 2:10:00 PM UTC-5, Nicholas Rondon wrote:
>
> I was writing code in python and when I ran the code, it wouldn't run and
> it showd an asterisk where it shows the number on the cell. Any help please?
>
Hello Roland,
First of all, sorry about the typo, lol. But I think that it isn't running
because when I clicked "run", the code it wouldn't do anything.
When you said that the code could have an an endless loop, I couldn't find
it (I'm new to this) this is the code.
Items = ""
Total = 0
def adding_report(report):
while True:
X = input("please input integer to add or Q to quit")
if X.isdigit() == "True":
X = int(X)
Total = Total + X
if report == "A":
Items = Items + X
elif X == "Q":
print("Your result is")
if report == "A":
print("Items")
print(Items)
print("total")
print(Total)
break
else:
print("invalid input.")
adding_report("T")
It's supposed to do addition. (It's for a project for an online class.) Can
you tell me where the infinite loop is please?
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/7b2ea1ea-d957-4b6d-8f15-0a32567977b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.