7/10/2020 8:18:54 AM
Zevil Evil why don't you try these things on code playground instead of asking it here.
You can do it using int() function.
Your both examples won't work
Ord is used to convert a string character into its equivalent ASCII value
Arsenic What about this:- print(2 + int("sam)) or print(2+int(sam)). Will it work?
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 And what is ord function?
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!
Zevil Evil it's Ok , no problem
Clearly give me sample input & output
I'll explain you with that
2 examples of converting a string into integer
c=int(a) + b
c=ord(a) + b
Send us a message