7 Answers
New AnswerPython
7/10/2020 8:18:54 AM
Zevil Evil7 Answers
New AnswerZevil Evil 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 a="12345" b=1122 c=int(a) + b print(c) a="K" b=16899 c=ord(a) + b print(c)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message