num1 = float(input())
num2 = float(input())
num3 = float(input())
num4 = float(input())
num1a = (num1*num2*num3*num4)
num2a = (num1+num2+num3+num4)/4
num3a = (num1*num2*num3*num4)
num4a = (num1+num2+num3+num4)/4
print(f'{num1a:.0f} {num2a:.0f}')
print(f'{num3a:.3f} {num4a:.3f}')
พอเห็นตัวอย่างก็ตั้งคูณหารธรรมดาไป ก็ผ่านแค่ข้อ 1 อีกสองค่า input งง ไปไม่ถูกเลย ช่วยอธิบายหน่อยค่ะ..
'''
Output differs. See highlights below.
Input 8.3 10.4 5.0 4.8
Expected output 2072 7
2071.680 7.125
Input -15.2 10.3 7.8 -9.7
Expected output 11845 -2
11845.330 -1.700
Input -2.3 -9.0 -6.5 -5.7
Expected output 767 -6
766.935 -5.875
โจทย์เลขไพทอน statistics-python
num2 = float(input())
num3 = float(input())
num4 = float(input())
num1a = (num1*num2*num3*num4)
num2a = (num1+num2+num3+num4)/4
num3a = (num1*num2*num3*num4)
num4a = (num1+num2+num3+num4)/4
print(f'{num1a:.0f} {num2a:.0f}')
print(f'{num3a:.3f} {num4a:.3f}')
พอเห็นตัวอย่างก็ตั้งคูณหารธรรมดาไป ก็ผ่านแค่ข้อ 1 อีกสองค่า input งง ไปไม่ถูกเลย ช่วยอธิบายหน่อยค่ะ..
'''
Output differs. See highlights below.
Input 8.3 10.4 5.0 4.8
Expected output 2072 7
2071.680 7.125
Input -15.2 10.3 7.8 -9.7
Expected output 11845 -2
11845.330 -1.700
Input -2.3 -9.0 -6.5 -5.7
Expected output 767 -6
766.935 -5.875