Entrer pi avec Python
Résolu
PAULHubert
Messages postés
2
Date d'inscription
Statut
Membre
Dernière intervention
-
PAULHubert Messages postés 2 Date d'inscription Statut Membre Dernière intervention -
PAULHubert Messages postés 2 Date d'inscription Statut Membre Dernière intervention -
Voici mon mini programme de test :
from math import *
x = input('angle en radians ',)
x=float(x)
y = sin(x)
print ('sinus de cet angle ',y)
Je peux entrer tout nombre mais pas pi car dans ce cas il plante et m'affiche :
angle en radians pi
Traceback (most recent call last):
File "C:\Users\Utilisateur\Documents\0000 Python\math1.py", line 3, in <module>
x=float(x)
ValueError: could not convert string to float: 'pi'
Comment faire pour entrer PI ? Merci d'avance pour vos réponses.
from math import *
x = input('angle en radians ',)
x=float(x)
y = sin(x)
print ('sinus de cet angle ',y)
Je peux entrer tout nombre mais pas pi car dans ce cas il plante et m'affiche :
angle en radians pi
Traceback (most recent call last):
File "C:\Users\Utilisateur\Documents\0000 Python\math1.py", line 3, in <module>
x=float(x)
ValueError: could not convert string to float: 'pi'
Comment faire pour entrer PI ? Merci d'avance pour vos réponses.
A voir également:
- Entrer pi avec Python
- Rechercher ou entrer l'adresse - Guide
- Entrer les informations d'identification reseau - Guide
- Citizen code python avis - Accueil - Outils
- Adresse IP locale : comment la trouver facilement - Guide
- Entrer code puk samsung - Guide