私は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:私は6ヶ月以来のpythonを使用するので、私は私がやっているか知っているが、私はプロ
おかげではないよ:D
これらの 'elif' ** _ statements _ **の中に入れる予定は何ですか? –
'elif'ブロックには何らかの内容が必要です。開発中に何もしない場合は、少なくとも 'pass'を追加してください。 – Matthias
「パス」とは何ですか? @Matthias – Blaxou