for computer science can someone help me with the first problem set
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
more specifically assigning the input of the users name to a variable
See to assign anything to a variable we follow the following syntax:
Now here value (name) is not prior known to us, what we want to do is ask the user to input the name so that we can store it or assign it to the a variable. To input something from user we follow the following syntax:
raw_input('Some text to display')
raw_input('Whats ur first name: ')
this will print the text and wait for user to input thru keyboard.
now since we want to store the input, we do the following:
firstName=raw_input('Whats ur first name: ')
now to print the firstName we simply do the follwing:
hope this was helpful.
Assigning basically has the form:
myVariable = someExpression
Where myVariable is the name of the variable you want to assign, and someExpression is an expression which will yield a value. In this case the expression you will use is a call to the function raw_input that will prompt the user for a string of text and return that text.