社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

Ayoub Benayache

Ayoub Benayache 最近创建的主题
Ayoub Benayache 最近回复了
6 年前
回复了 Ayoub Benayache 创建的主题 » python中如何在负数前加括号

只需在第二个测试中为每个var和chnge+to-添加()就可以了,因为+with-=-

a=int(input("Enter the value of a:"))
b=int(input("Enter the value of b:"))
c=int(input("Enter the value of c:"))
d = (b)**2-(4*(a)*(c))
if b>0 and c>0:
    print("The quadratic equation is : " + str(a) + "x2+" + str(b) + "x+" + str(c))
elif b<0 and c<0:
    print("The quadratic equation is : " + str.format(a) + "x2" + str(b) + "x" + str(c))
6 年前
回复了 Ayoub Benayache 创建的主题 » 如何在python的列表中找到输入的位置[副本]
# vowels list
vowels = ['a', 'e', 'i', 'o', 'i', 'u']



# index of i item is printed
for i in vowels:
    print('The index of:', i+" "+str(vowels.index(i)))