Problem set #0 For the code x = raw_input ('Name: ') y = raw_input ('Date of Birth: ')Basically i have to write the first line (x) press enter and write the name, then write the second line (y) press enter and write the date. Then print x,y. Is it possible to write both lines press enter and assign both x and y?
x, y = raw_input("Name: "), raw_input("Date of Birth: ")
you still have to press enter for each prompt, but that gets it done in one line
if you are willing to forego the prompts, you can write x, y = 'Fred', 'July 7' and that will assign x to 'Fred' and y to 'July 7', but again, you won't get the prompts
Usually, the Python download has IDLE. IDLE is an IDE (Integrated Development Environment). Fancy term that means a text editor tied into Python and some debugging tools. The upshot is: you could, and with more complex programs will, write your program with the editor and then run your program (in IDLE, I think it's the F5 key).
Is this an efficient program? or is yours better 'Turing test' print ('Whats your date of birth:') DOB = raw_input('') print ('Enter your last name:') Last = raw_input ('') print (Last, DOB)
very clever @brb_96
thanks
Join our real-time social learning platform and learn together with your friends!