2017-07-20 9 views
-1

上の構文エラーで私を助けることができます。あなたのすべての助けに感謝します。は、いくつかのいずれかは、私は、多くの異なるものを試してみましたし、それが仕事を得ることができないとして、このコードで私を助けてくださいパイソン

print(" Greenfly Population Model") 
chocies=[] 


def option0(): 
    time.sleep(1) 
    print("GOOD BYE") 
    time.sleep(1) 
    # exiting the loop 

def option1(): 
    if choies==[]: 
     print("Set the Generation 0 values!") 
    else: 
     print(chocies[:]) 
def option2(): 
    print("Display the Generation 0 values") 


def option3(): 
    print("Run the model") 

def option4(): 
    print("Export data") 

def option5(): 
    print("Quit") 





import time#for option 0 
while True:#to keep the program continuous 
    option=int(input(""" 
    High Scores 


0- Exit 
1- Show score 
2- Add a score 
3- Delete a score 
4 - Sort the score in ascending order 
5- Sort the score in descending order 
""")#all different options 


s = int(input("from the menu above please pick your choice")) 
print("setting the generation 0 values")) 
i = int(input("Enter the number of generations you want the model to run for (must be between 5 and 25 inclusive")): 
m = int(input("Choose adult survival rate between 0 and 1:")) 
o = int(input("Choose Juvenile survival rate between 0 and 1:")) 
n = int(input("Choose Senile survival rate between 0 and 1:")) 
r = int(input("please enter the initial numbers of juvenile:")) 
a = int(input("please enter the initial numbers of adults:")) 
i = int(input("please enter the initial numbers of seniles:")) 
v = int(input("please enter the initial numbers of the adults:")) 

print(s) 
print(i) 
print(m) 
print(o) 
print(n) 
print(r) 
print(a) 
print(i) 
print(v) 



print(" Greenfly Population Model") 
option=int(input(""" 
High Scores 


0- Exit 
1- Show score 
2- Add a score 
3- Delete a score 
4 - Sort the score in ascending order 
5 - Sort the score in descending order 
""")#all different options 

私の構文エラーが私の構文エラー

+0

あなたの質問と動作しないコードの部分で具体的になります。 –

+4

前の行に閉じ括弧がありません。 –

+1

あなたはどのPythonバージョンを使用していますか? –

答えて

2

は、あなたが(起動するエンド)、いくつかの問題を抱えてここで、sは

s = int(input("from the menu above please pick your choice")) 

です:最後に)を逃し

  1. を... """)#all different options - >"""))#all different options
  2. この種のエラーは非常に有用である後に一致ブラケットと、このようなチェック print("setting the generation 0 values"))ラインで1~48

同じ

  • であってはならないi = int(input("Enter the number of generations you want the model to run for (must be between 5 and 25 inclusive")):
  • )
  • であってはならない
  • : :)

    固定バージョン:

    print(" Greenfly Population Model") 
    chocies=[] 
    
    
    def option0(): 
        time.sleep(1) 
        print("GOOD BYE") 
        time.sleep(1) 
        # exiting the loop 
    
    def option1(): 
        if choies==[]: 
         print("Set the Generation 0 values!") 
        else: 
         print(chocies[:]) 
    def option2(): 
        print("Display the Generation 0 values") 
    
    
    def option3(): 
        print("Run the model") 
    
    def option4(): 
        print("Export data") 
    
    def option5(): 
        print("Quit") 
    
    
    
    
    
    import time#for option 0 
    while True:#to keep the program continuous 
        option=int(input(""" 
        High Scores 
    
    
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5- Sort the score in descending order 
    """))#all different options 
    
    
    s = int(input("from the menu above please pick your choice")) 
    print("setting the generation 0 values") 
    i = int(input("Enter the number of generations you want the model to run for (must be between 5 and 25 inclusive")) 
    m = int(input("Choose adult survival rate between 0 and 1:")) 
    o = int(input("Choose Juvenile survival rate between 0 and 1:")) 
    n = int(input("Choose Senile survival rate between 0 and 1:")) 
    r = int(input("please enter the initial numbers of juvenile:")) 
    a = int(input("please enter the initial numbers of adults:")) 
    i = int(input("please enter the initial numbers of seniles:")) 
    v = int(input("please enter the initial numbers of the adults:")) 
    
    print(s) 
    print(i) 
    print(m) 
    print(o) 
    print(n) 
    print(r) 
    print(a) 
    print(i) 
    print(v) 
    
    
    
    print(" Greenfly Population Model") 
    option=int(input(""" 
    High Scores 
    
    
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5 - Sort the score in descending order 
    """))#all different options 
    
  • 0

    これは何ですか私はこれまでにやったことがあります

    print(" Greenfly Population Model") 
    
    chocies=[] 
    
    
    def option0(): 
        time.sleep(1) 
        print("GOOD BYE") 
        time.sleep(1) 
        # exiting the loop 
    
    def option1(): 
        if chocies==[]: 
         print("Set the Generation 0 values!") 
        else: 
         print(chocies[:]) 
    def option2(): 
        print("Display the Generation 0 values") 
    
    
    def option3(): 
        print("Run the model") 
    
    def option4(): 
        print("Export data") 
    
    def option5(): 
        print("Quit") 
    
    
    
    
    
    import time#for option 0 
    while True:#to keep the program continuous 
        option=int(input(""" 
    
    (""" 
    print(" Greenfly Population Model") 
    chocies=[] 
    
    
    def option0(): 
        time.sleep(1) 
        print("GOOD BYE") 
        time.sleep(1) 
        # exiting the loop 
    
    def option1(): 
        if choies==[]: 
         print("Set the Generation 0 values!") 
        else: 
         print(chocies[:]) 
    def option2(): 
        print("Display the Generation 0 values") 
    
    
    def option3(): 
        print("Run the model") 
    
    def option4(): 
        print("Export data") 
    
    def option5(): 
        print("Quit") 
    
    
        High Scores 
    
    (""" 
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5- Sort the score in descending order 
    """)#all different options 
    
    
    s = int(input("from the menu above please pick your choice")) 
    print("setting the generation 0 values")) 
    i = int(input("Enter the number of generations you want the model to run for (must be between 5 and 25 inclusive")): 
    m = int(input("Choose adult survival rate between 0 and 1:")) 
    o = int(input("Choose Juvenile survival rate between 0 and 1:")) 
    n = int(input("Choose Senile survival rate between 0 and 1:")) 
    r = int(input("please enter the initial numbers of juvenile:")) 
    a = int(input("please enter the initial numbers of adults:")) 
    i = int(input("please enter the initial numbers of seniles:")) 
    v = int(input("please enter the initial numbers of the adults:")) 
    
    print(s) 
    print(i) 
    print(m) 
    print(o) 
    print(n) 
    print(r) 
    print(a) 
    print(i) 
    print(v) 
    
    
    (""" 
    print(" Greenfly Population Model") 
    option=int(input 
    High Scores 
    
    
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5 - Sort the score in descending order 
    #all different options 
    
    
    """) 
    
    
    import time#for option 0 
    while True:#to keep the program continuous 
        option=int(input(""" 
        High Scores 
    
    
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5- Sort the score in descending order 
    """))#all different options 
    
    
    s = int(input("from the menu above please pick your choice")) 
    print("setting the generation 0 values") 
    i = int(input("Enter the number of generations you want the model to run for (must be between 5 and 25 inclusive")) 
    m = int(input("Choose adult survival rate between 0 and 1:")) 
    o = int(input("Choose Juvenile survival rate between 0 and 1:")) 
    n = int(input("Choose Senile survival rate between 0 and 1:")) 
    r = int(input("please enter the initial numbers of juvenile:")) 
    a = int(input("please enter the initial numbers of adults:")) 
    i = int(input("please enter the initial numbers of seniles:")) 
    v = int(input("please enter the initial numbers of the adults:")) 
    
    print(s) 
    print(i) 
    print(m) 
    print(o) 
    print(n) 
    print(r) 
    print(a) 
    print(i) 
    print(v) 
    
    
    
    print(" Greenfly Population Model") 
    option=int(input(""" 
    High Scores 
    
    
    0- Exit 
    1- Show score 
    2- Add a score 
    3- Delete a score 
    4 - Sort the score in ascending order 
    5 - Sort the score in descending order 
    """))#all different options 
    
    関連する問題