Apr-26-2017, 05:19 AM
(Apr-21-2017, 02:14 AM)dave925 Wrote: Thanks for all your replies. To answer what I was doing that led to the question:
I started my program declaring my variables.
day, date, topic = '','',''
then I declared my title using the above variables....
title = day+date+topic
then, I started my program with a loop which altered the day, date, and topic, but I noticed that when I wanted to write the title, it was just blank because the variables weren't fluid within my variable declaration. I suppose, like you all are saying, I would need to declare my title as a List or Dictionary to make the variables modifiable.
Thanks again!
If you don't want to write
title = day+date+topic
inside whatever loop you're using, then you could write a small function like:def get_title(day, date, topic): return "{0}{1}{2}".format(day, date, topic)...and just use the function instead. But having a string who's contents change depending on where you are in your program, is a pathway that leads directly to madness.