- 5
Addition of two numbers
9 Respostas
+ 3
Python:
a = 40
b = 2
print(str(a + b))
outpet: 42
+ 3
Potato Squad it seems I was wrong.
Thank you for correcting me
+ 2
Potato Squad that example is 402
because it's a string. It would be better like this.
a = 40
b = 2
print(int(a + b))
outpet: 42
+ 2
Ramyajayanthi
(chaining is addition of string with some type).
It will work without the str either in this case but I send it just in case you will think python chaining it's like java or another language (string + int = string) in python you need to use str function in chaining or use string formatting.
+ 1
Really?
+ 1
Lol
+ 1
Better: addition of two strings
+ 1
Minecraft Destroyer HD
ok thanks.