Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 9 Online
OpenStudy (anonymous):

Inside the main method, variable x has already been declared as an int and has been assigned a value of 5. Which of the following statements would later give x a new value of 10? 10 = x; int x = 10; x + 5; x = 10;

OpenStudy (anonymous):

you assign values with '=' whatever is on the right gets copied to what's on the left. you use things like 'int' to create memory but you already created memory for x so you can't do it again

OpenStudy (anonymous):

So it would be int x = 10; ...? @iamheretohelp

OpenStudy (anonymous):

no because you already created an int. you're just reassigning a value.

OpenStudy (anonymous):

Oh I misread what you said above. x = 10?

OpenStudy (anonymous):

yeah thats right

OpenStudy (anonymous):

I see now. Thanks! :)

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!