for problem set 0, i am typing "birthdate = raw_input('Enter your birthdate: ')" and then pressing enter and typing my birthdate and then pressing enter and typing "name = raw_input('Enter your name: ')" and then pressing enter and typing my name and then pressing enter and typing "print(name + birthdate)" in order to complete the assignment. is there a way to write the program all before so that, when run, it asks for birthdate, then the user types it, then it asks for a name, then the user types it, and then it prints out the name and the date?
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!
try this and let me know if it works!
birthdate = raw_input('Enter your birthdate: ')
if str() in birthdate:
name=raw_input('Please, write your name: ')
if str() in name:
print" Your name is", inputb, " and your birthdate is", inputa, "."
since you used raw_input i figured u r running Python 2.x. u might want to experiment with the type handling in the code because in its current state i think it is crash-prone
i think i might be typing this in the wrong spot... in which window am i supposed to type the code? in the IDLE window? i'm a bit confused as a beginner, thanks for your help!
if u want to use this piece again click on File>New while on the IDLE window. then type in exactly as u see it. pay close attention to the white spaces(indentations).or copy and paste it. but if you just want the interactive mode where you type in and get response there and then, type the code when you see the >>> prompt. feel free to ask me if anything isn't clear!
Not the answer you are looking for? Search for more explanations.
thank you so much! it makes sense now, i was typing after the >>> and that was confusing me. you're the best!
OK! am glad it worked out well for u!
I did it this way in homework_1.py and it ran fine. I hope that was what was wanted ;-)
print ("********** Exercise 1.5 **********")
firstName = raw_input('Enter your first name: ')
lastName = raw_input('Enter your last name: ')
print 'Enter your date of birth: '
month = raw_input('Month? ')
day = raw_input('Day? ')
year = raw_input('Year? ')
print 'Chuck Norris was born on March 10, 1940.'