So according to the Zen of Python ... Explicit is better than implicit...Sparse is better than dense...Readability counts...but then agai
First, if you are a beginner, don't worry what is more pythonic or not. This smell language wars, and you will eventually find your own opinion anyway. Just use the way you think is more readable/simpler for you and you will find the light, I think.
That said, I agree with Alex's excellent answer (as he is always right) and I would add an additional comment why you should prefer the second method - the first will only work correctly if val is a string.