Python Drawing Pie Chart/Bar Graph using while loop
<p>I'm having difficulty starting a while loop trying to generate a program that will generate a pie chart or bar graph from numbers that a user will input. How does the while loop need to be written so it's not looping forever? I know I could use a for loop for a finite sequence but i'm not too experienced in that. any guidance would be helpful!</p>

<p>from SimpleGraphics import *</p>

<p>print("Chart Menu: 1.Pie Chart, 2.Bar Chart")</p>

<p>chart = int(input("enter either 1 for pie chart or 2 for bar chart:"))</p>

<p>if chart == 1:</p>

<pre><code> title = input("Enter the title of the chart: ")

 numSec = int(input("Enter the number of sectors: "))

 tSum = int(input("Enter the total sum of all sector values:  "))

 gsize = int(input("Ehter the grid size (Between 10 and 400): "))

 yLabel = input("Enter the label for the Y-Axis:")
</code></pre>

<p>while loop</p>

<p>-the name of each sector</p>

<p>-the value each  sector</p>

<p>-draw pie chart</p>

<p>if chart == 2:</p>

<pre><code>title = input("Enter the title of the chart: ")

numCat = int(input("Enter the number of categories: "))

grid = int(input("Ehter the grid size (Between 10 and 400): "))
</code></pre>

<p>while loop</p>

<p>-name of each category</p>

<p>-value for that category</p>

<p>-draw bar graph</p>