topic description
answer
When I saw this question, I didn't even think about it. I thought it was very simple, so I just wrote
a = int(input())
b = int(input())
c = int(input())
print(b*b-4*a*c)
Then, I was severely slapped in the face.
Then, I found out that I still haven't fully grasped how to use the input function. In the title, it said "enter three values in one line ", highlight the key, in one line! ! !
Obviously, this way, the wrapping output is correct
input().split
The input() function receives multiple user inputs and needs to be used in conjunction with split()
name, number, age = input('请输入姓名、号码和年龄:').split()
print(name, number, age)
String splitting function str.split()
Function prototype:
str.split(str="", num=string.count(str))
information = "lmy/19/2020/female"
gap = information.split('/', 3)
print(gap)
output :
correct answer
a, b, c = input().split()
a, b, c = eval(a), eval(b), eval(c)
print(b*b-4*a*c)