Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
44 Online
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?
Still Need Help?
Join the QuestionCove community and study together with friends!
Cast it as a string. int val=5 print ("you are " + str(val) + " yrs old!")
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
lol, debugging, always a good time. Good luck.
http://pastebin.com/1v5dHhLM http://docs.python.org/library/string.html#format-string-syntax
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!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
Gdub08:
You have three ovens. I coal oven, a firewood oven, and a electric oven. But only 1 match.
Gdub08:
You have three ovens. I coal oven, a firewood oven, and a electric oven. But only 1 match.
NaZebk:
Steppin' through the block, got the blicky in my waist, Enemies lurkin', better know they place, Brody in the back, he ainu2019t catchinu2019 no case, We mo
gelphielvr:
What's the difference between colonization and imperialism
gelphielvr:
How can I identify the text structures compare and contrast, problem and solution
gelphielvr:
I need tips on how to memorize long formulas does anyone have any
23 hours ago
7 Replies
0 Medals
23 hours ago
0 Replies
0 Medals
8 minutes ago
17 Replies
0 Medals
20 hours ago
2 Replies
0 Medals
1 day ago
0 Replies
0 Medals
4 hours ago
4 Replies
0 Medals