Context:
I'm doing the Udemy "100-days-of-code" course and hit a weird stumbling block.
Python version: 2.7-64
I ultimately solved it by using the "input" command (vs raw_input) and upgrade the version of Python to 3.X.
The problem simply went away.
Thus, I didn't really solve the original problem.
If you can help: What was I missing?
Scenario:
I used two raw_input() calls for input from the user. I then included the input in a summary.
Problem:
It is overriding the beginning of the summary for some reason.
Code:
# done this way to for input to be on the beginning
# yes I know I could have simply done city = raw_input("Birth city?\n"), etc
print("Birth city?")
city = raw_input()
print("Favorite pet?")
pet = raw_input()
print("Your band name would obviously NEVER be " + str(city) + " " + str(pet))
Output:
Birth city?
Angela
Favorite pet?
Lansbury
Lansbury name would obviously NEVER be Angela
Expectation:
Birth city?
Angela
Favorite pet?
Lansbury
Your band name would obviously NEVER be Angela Lansbury
Thanks for any clarification provided.
Supplemental attempt details:
I tried using the input command - but it didn't work for me. I suspect it's because I had 2.7 installed.
I tried storing both variables in a separate variable Iterating over this I found it retained only the first - dropping whichever i added second. (Which is also interesting - but doesn't explain why it was overriding the beginning