Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 17 Online
OpenStudy (anonymous):

how to create username using by first letter of name and inter last name in pyhton?

OpenStudy (e.mccormick):

Well, depends on how the input is taken in. What have you done so far?

OpenStudy (mandre):

Each string is an array of letters so you can use this simple method: first = "Sam" second = "Whitmore" username = first[0]+second print(username) If you run this you will get: SWhitmore

OpenStudy (mandre):

first[0] = "S" first[1] = "a" first[2] = "m" second[0] = "W" second[1] = "h" and so on.

OpenStudy (e.mccormick):

Ah, but if they get the name as one string then it changes.

OpenStudy (mandre):

True, but it looks like @mf14 has abandoned us. Hopefully others can learn from this. I've only started learning Python myself when I can find time in between studies.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!