why can I convert string to integer and then add it to integer‚Ěď‚Ěď | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 1

why can I convert string to integer and then add it to integer‚Ěď‚Ěď

Python

10th Jul 2020, 8:18 AM
Zevil Evil
Zevil Evil - avatar
4 Respostas
+ 3
Zevil Evil why don't you try these things on code playground instead of asking it here.
10th Jul 2020, 8:54 AM
Arsenic
Arsenic - avatar
+ 2
You can do it using int() function.
10th Jul 2020, 8:21 AM
Arsenic
Arsenic - avatar
+ 1
Arsenic What about this:- print(2 + int("sam)) or print(2+int(sam)). Will it work? ūĚźäūĚźĘūĚźĘūĚźõūĚź® ūĚźÜūĚź°ūĚźöūĚź≤ūĚźöūĚź• And what is ord function?
10th Jul 2020, 8:48 AM
Zevil Evil
Zevil Evil - avatar
+ 1
Arsenic I tried mahn. It didn't work. That's why I was asking? Have I done something wrong or do I need to follow a different concept? btw, thank for the reply!
10th Jul 2020, 9:01 AM
Zevil Evil
Zevil Evil - avatar