+ 2

How do i replace a and b with the inputed value in the string

https://code.sololearn.com/cK3KFfnvY6X3/?ref=app

21st Apr 2019, 3:48 PM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
2 ответов
+ 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)
21st Apr 2019, 3:54 PM
Anna
Anna - avatar
+ 2
To add another part can i use , in stead of + if you know what i mean
21st Apr 2019, 4:42 PM
Kristi Teneqexhi
Kristi Teneqexhi - avatar