-1

So basically i'm stuck with my code and it's for homework and i don't know how to fix the error that i'm getting "unindent does not match any outer indentation level" I've tried to fix it myself but i haven't had any success, so i'm reaching out to anyone that would like to help me.

Here's my code

exit = False
while not exit:
  #variables
  name=str(input("Enter your students name "))

  #User ratings for rolleston spirit
  DSR=int(input("Enter rating for Develop Self "))
  BCR=int(input("Enter rating for Building Communities "))
  TFR=int(input("Enter rating for Transforming Futures "))    

  #If the input is above a certain number, it will print the student is doing well and if an input is below a ceratin number it will print the student needs support in .....
  if DSR>=6:
    print (name, "is doing well in developing self")
  elif DSR<4:
    print (name," needs support in developing self")
  if BCR>=6:
    print (name, "is doing well in Building Communities")
  elif BCR<4:
    print (name," needs support in Building Communities")
  if TFR>=6:
    print (name, "is doing well in Transforming Futures")
  elif TFR<4:
    print (name," needs support in Transforming Futures")

  #Function to find the highest number in a list
  def maxi(items):
  #max finds the highest number in a list
   return max(items)
  print(name, "highest score was ", maxi([DSR, BCR, TFR]))

#function to get average of a list 
  def Average(lst): 
      return sum(lst) / len(lst) 
# Creating List 
  lst = [DSR, BCR, TFR] 
  average = Average(lst) 
# Printing average of the list 
  print(name, "has an overall rating of ", round(average, 2))
  rep=str(input("Do you wish to continue? Y/N "))

 if rep=="Y":
   print ("  ")
 elif rep =="N":
   exit = True
print("  ")

Expected output of the code.

Enter your students name Name
Enter rating for Develop Self 3
Enter rating for Building Communities 7
Enter rating for Transforming Futures 9
Name  needs support in developing self
Name is doing well in Building Communities
Name is doing well in Transforming Futures
Name highest score was  9
Name has an overall rating of  6.33
Do you wish to continue? Y/N
George
  • 1
  • 1
  • Your indentation is messed up - use a code editor which does smart indents for you. – meowgoesthedog Jun 04 '19 at 12:42
  • Welcome to StackOverflow. Show the full traceback for the error message--that will show the source of the problem (or something close to it). Read and follow [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Rory Daulton Jun 04 '19 at 12:46
  • Like everyone said, your indentation is wrong, try using 4 spaces for an indentation and using a code editor would be a big help for you as well. Also, I don't know the assignment, but when you check the numbers, you do nothing with `5`. Maybe that is suppose to happen, but I just wanted to let you know. – funie200 Jun 04 '19 at 12:59

1 Answers1

1

There might be spaces mixed with tabs in your code and you need 4 spaces to indent. Try this :

exit = False
while not exit:
    #variables
    name=str(input("Enter your students name "))

    #User ratings for rolleston spirit
    DSR=int(input("Enter rating for Develop Self "))
    BCR=int(input("Enter rating for Building Communities "))
    TFR=int(input("Enter rating for Transforming Futures "))    

    #If the input is above a certain number, it will print the student is doing well and if an input is below a ceratin number it will print the student needs support in .....
    if DSR>=6:
        print (name, "is doing well in developing self")
    elif DSR<4:
        print (name," needs support in developing self")
    if BCR>=6:
        print (name, "is doing well in Building Communities")
    elif BCR<4:
        print (name," needs support in Building Communities")
    if TFR>=6:
        print (name, "is doing well in Transforming Futures")
    elif TFR<4:
        print (name," needs support in Transforming Futures")

#Function to find the highest number in a list
def maxi(items):
    #max finds the highest number in a list
    return max(items)
print(name, "highest score was ", maxi([DSR, BCR, TFR]))

#function to get average of a list 
def Average(lst): 
    return sum(lst) / len(lst) 
# Creating List 
lst = [DSR, BCR, TFR] 
average = Average(lst) 
# Printing average of the list 
print(name, "has an overall rating of ", round(average, 2))
rep=str(input("Do you wish to continue? Y/N "))

if rep=="Y":
    print ("  ")
elif rep =="N":
    exit = True
print("  ")
F Blanchet
  • 1,430
  • 3
  • 21
  • 32