What will happen if i do | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

What will happen if i do

print(" sam " ** 2)

8th Jul 2018, 9:21 AM
Karan Mali
Karan Mali - avatar
3 Answers
+ 6
" sam " is a string but not a number. Therefore the result is an error. I guess you need to print the word twice? fyi: (" sam " * 2 means " sam " ** 2) in Python. What do you expect from the code?
8th Jul 2018, 9:33 AM
Dev
Dev - avatar
+ 1
Depending on the language, the string " sam" could be type-casted into an integer.
8th Jul 2018, 10:13 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
0
thanx
8th Jul 2018, 9:52 AM
Karan Mali
Karan Mali - avatar