Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 44 Online
OpenStudy (anonymous):

I am working on PS1, and I'm having trouble piping the result of my "is it prime" test into a string. How do you take the integer result of a mathematical equation and append it to a string value?

OpenStudy (espex):

Cast it as a string. int val=5 print ("you are " + str(val) + " yrs old!")

OpenStudy (anonymous):

Thank you! I realized almost immediately after posting this that the problem wasn't setting the integer as a string anymore - it was a problem with the algorithm I was using. Back to debugging! :D

OpenStudy (espex):

lol, debugging, always a good time. Good luck.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
midnightriver46: Is anyone learning korean in here?
36 minutes ago 18 Replies 1 Medal
Gucchi: physics
21 hours ago 17 Replies 0 Medals
Gucchi: physics
23 hours ago 10 Replies 0 Medals
gelphielvr: What's the difference between colonization and imperialism
20 hours ago 2 Replies 0 Medals
gelphielvr: I need tips on how to memorize long formulas does anyone have any
4 hours ago 4 Replies 0 Medals
gelphielvr: how do I find the valance electrons? no further info
4 hours ago 1 Reply 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!