Help

49 views
Skip to first unread message

Nicholas Rondon

unread,
Oct 8, 2017, 3:10:00 PM10/8/17
to Project Jupyter
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?

Roland Weber

unread,
Oct 9, 2017, 2:08:46 AM10/9/17
to Project Jupyter
Hello Nicholas,


On Sunday, October 8, 2017 at 9:10:00 PM UTC+2, 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?

Sounds like you code is entering an endless loop. I recommend to debug and fix your code.

Can you provide more information on "it wouldn't run"? Because the asterisk usually indicates that the code begins to run. What makes you think that it doesn't?
Put some print statements at the beginning, end, and strategically selected places within your code to verify the progress.

cheers,
  Roland

Nicholas Rondon

unread,
Oct 14, 2017, 6:44:51 PM10/14/17
to Project Jupyter


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?

Roland Weber

unread,
Oct 16, 2017, 2:34:07 AM10/16/17
to Project Jupyter
Hello Nicholas,

it's much easier to spot a problem when there's code to look at :-)


        X = input("please input integer to add or Q to quit")

Do you even see the prompt? I'm not sure whether console-like input is supposed to be working in the web UI.

cheers,
  Roland

Thomas Kluyver

unread,
Oct 16, 2017, 3:25:14 AM10/16/17
to Project Jupyter
Do you even see the prompt? I'm not sure whether console-like input is supposed to be working in the web UI.

It is supposed to be.
Reply all
Reply to author
Forward
0 new messages