title: How to add user inputs in python?
body: <p>I'm doing a problem where I need to find the total of the user input. But when I do it, it only outputs the last user input. Here's what I got.</p>
  
  <pre><code>#Ask for the number of days of weather data they have
  weather = int(input("How many days of weather data do you have? "))
  
  total=0
  x=1
  
  #Ask what the rainfall was for each day
  while(x&lt;=weather):
      temp_weather = input("What is the rainfall for day " +str(x)+"? ")
      x=x+1
  
  #Add the total rainfall output
  while(temp_weather&gt;total):
      total= total+temp_weather
      print("The total rainfall for the period was "+ str(weather))
  </code></pre>