Tell me please.I have a database and a table from which I take the name and surname, but in the database not all users with a name and a surname and I want to break out what I pull from one variable to 2.Now I do this:
fullname="Vasya Pupkin" firstname, lastname=fullname.split()
In this situation, everything works correctly, but those with only one word come across and then errors are made
fullname="Vasya" firstname, lastname=fullname.split()
How, then, to be? How to make, instead of the second word substitute an empty space or just did nothing?
Thanks in advance.