Question: I wrote this in python and I can't get it to work. Please help me to correct it >>> sum = int(0) >>> number=int (0)

I wrote this in python and I can't get it to work. Please help me to correct it

I wrote this in python and I can't get it to work.

>>> sum = int(0) >>> number=int (0) >>> print ("Enter a positive whole number or Owhen done") Enter a positive whole number or Owhen done >>> number = int(input()) while (number>0) Traceback (most recent call last): File "", line 1, in number = int (input()) ValueError: invalid literal for int() with base 10: 'while (number>0)' >>> while (number>0): sum=sum+number print ("Enter a positive whole number or when done") number - int (input()) print ("Ther sum of number input is ", sum) SyntaxError: invalid syntax >>> sum = int(0)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!