缩进错误但不明白为什么?

Indentation Error but don't understand why?

我写了一个python程序,当我启动它时,它说有一个IndentationError,我知道它是什么但不明白为什么。一切对我来说似乎都是合法的:/

# encoding : utf-8

from math import *
def menu():
    print("""
    Choisissez parmi ces actions :

    [1]    Afficher un vecteur donné par deux points
    [2]    Afficher le résultat de l'addition ou de la soustraction de deux vecteurs
    [3]    Afficher le résultat de la multiplication d'un vecteur par un nombre
    [4]    Afficher le produit scalaire de deux vecteurs de R2 ou de R3
    [5]    Afficher le produit vectoriel de deux vecteurs de R3
    [6]    Afficher la norme d'un vecteur
    [7]    Afficher la normalisation d'un vecteur
    [8]    Afficher le projeté orthogonal d'un vecteur sur un autre
    [9]    Afficher l'angle (compris entre 0° et 180°) entre deux vecteurs
    [10]   Afficher si un vecteur est unitaire ou non
    [11]   Afficher si deux vecteurs sont colinéaires ou non
    [12]   Afficher si deux vecteurs sont orthogonaux ou non

    [0]    Quitter le programme
    """)

    choice =input()
    if choice == "1":
        print("Entrez votre vecteur sous la forme d'une liste : ")
        vector = eval(input("Vecteur"))
        print(vector)
    elif choice == "2":

    elif choice == "3":
#it says that the line just above contains an error
    elif choice == "4":

    elif choice == "5":

    elif choice == "6":

    elif choice == "7":

    elif choice == "8":

    elif choice == "9":

    elif choice == "10":

    elif choice == "11":

    elif choice == "12":

    elif choice == "0":
        return None

不要介意法语部分,这不重要。重要的部分是 elif 函数。

PS:我使用 python 已经 6 个月了,所以我知道自己在做什么,但我不是专业人士

谢谢 :D

':' 下方的内容不能留空。

如果您不想做任何事情,请写:

elif choice == "2":
   pass

你不能这样写:

elif choice == "2":

elif choice == "3":

这会引发 IndentationError 异常,因此如果您想稍后实现它,您可以像下面这样使用 pass statement

elif choice == "2":
    pass

elif choice == "3":
    pass

来自 pass 文档:

The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action.