bverjee wrote:
I just started learning Python this month and I have a question:
I want the variable "birthday" to be 7/18/1996. Why can't I make the integers into strings? (see line 4)
line 1: month_born = 7
line 2: day_born = 18
line 3: year_born = 1996
line 4: birthday = (str(month_born) + "/" + str(day_born) + "/" + str(year_born))
I know I can just us "end = "" " and print the slashes separately, but why can't I do it this way?
Thanks;)
Try doing the same, but replace the slashes with something else. If it works, and you still need the slashes, replace them with "\ \".
If you're wondering about the theory behind this, look up the notion of escape characters.