Why cant 34 and "34" in answer be d same? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why cant 34 and "34" in answer be d same?

3rd Aug 2016, 3:37 PM
Karan Shirur
Karan Shirur - avatar
6 Answers
+ 2
The string 34 and the int 34 might look the same as output but they are different datatypes, they are used and operated on differently by Python programs.
9th Aug 2016, 9:31 AM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar
+ 6
34 is an integer while "34" is a string.
3rd Aug 2016, 4:24 PM
Sruti Sarayan
+ 2
34 is an integer but "34" represents a string . if you wanna print 34 you can use print (34) but if you want to print "34" I think you'll have to use print("\"34"") I think
3rd Aug 2016, 4:25 PM
NOBODY
+ 2
x=34 print (x) this will give output as integer which is stored at x whereas print ("34") this will give output as string
4th Aug 2016, 3:13 AM
shrishank sinha
shrishank sinha - avatar
+ 1
Thats all right, i understand but if i put x = 34 Print(x) Print "34" Both will be the same wont they??
3rd Aug 2016, 4:28 PM
Karan Shirur
Karan Shirur - avatar
0
if you take x=34 you can use it for doing any arthematic operations, but if you take x="34" you can't do.
17th Aug 2016, 10:21 AM
Krishna
Krishna - avatar