format(1):num1 = eval(input(‘input num1:‘)) num2 = eval(input(‘input num2:‘)) sum1 = float(num1) + float(num2) ~1#print ((‘{0}+{1}={2}‘.format(num1, num2, sum1))) ~2#print ((‘{x}+{y}={z}‘.format(x=num1, y=num2, z=sum1)))
format(2): fmt = ‘{0:15} ${1:>6}‘ print (fmt.format(‘Registr‘, 888835))
时间: 2024-10-12 12:11:37