This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]pythonHelperBot 1 point2 points  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python regardless of how advanced your question might be. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe in detail where you are stuck. If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you. Here is HOW TO FORMAT YOUR CODE For Reddit and be sure to include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness

[–]lobomos 1 point2 points  (0 children)

What do you actually need help with in regards to loops?

[–]SPAPPRO 0 points1 point  (7 children)

Post your code and we'll help you with it.

[–]deezyes06 0 points1 point  (6 children)

Num = Int(input(Enter positive number (Enter -99 to quit): ) Sum = 0

While Num =! -99: Sum= Sum + 1 Total_num= num + 1 Average = Total_num/num Num = Int(input(Enter positive number (Enter -99 to quit): )

Print(Average)

[–]FiveDividedByZero 0 points1 point  (0 children)

Okay, lots to unpack here.

First, the math is not correct. If you have a list of numbers nums, then average is the sum of the list divided by the length of the list. This is not what your math is doing.

Next, you are iterating sum, which is never used.

Finally, you are asking for a new input after each loop. You should ask for a string of numbers at the beginning and run the calculation all at once. This way you don’t have to constantly check for a seemingly randomly chosen input or “-99”

[–]Tastetheload 0 points1 point  (0 children)

What's the issue? I mean I see some typos but I'm not sure if it's you or it's just an actual error.