+ 2
How do i replace a and b with the inputed value in the string
2 Respuestas
+ 2
print(str(a) + '/' + str(b) + ' is: ' + str(a/b))
or
print(f'{a}/{b} is: {a/b}')
or
print('{}/{} is: {}'.format(a, b, a/b))
or
print('%.3f/%.3f is: %.3f' % (a, b, a/b))
The last one is kind of deprecated and shouldn't be used (personally, I still like it)
+ 2
To add another part can i use , in stead of + if you know what i mean