Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 8 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
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 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!