私信  •  关注

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)))