Python Forum
Name Mashup Program Improvement in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Name Mashup Program Improvement in Python
#2
One can split input and construct new string on the fly (I didn't see any requirements how the mashup should be created), requires 3.6 <= Python for f-strings:

first_name = input('Enter full name (first, last): ' ).split()
second_name = input('Enter full name (first, last): ').split()

print(f"{first_name[0][0]}{second_name[0][1:]} {first_name[1][0]}{second_name[1][1:]}")
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: Name Mashup Program Improvement in Python - by perfringo - Apr-05-2020, 08:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random coordinate generator speed improvement saidc 0 2,135 Aug-01-2021, 11:09 PM
Last Post: saidc
  Function Improvement Santino 1 1,875 May-23-2020, 03:30 PM
Last Post: jefsummers
  first try with python class, suggestion for improvement please anna 18 6,291 Nov-01-2019, 11:16 AM
Last Post: anna
  coding improvement tips vaisesumit29 1 1,904 Mar-10-2019, 05:09 PM
Last Post: stullis
  Web Scraping efficiency improvement HiImNew 0 2,446 Jun-01-2018, 08:52 PM
Last Post: HiImNew
  Router interface status through SNMP - suggestion required for improvement. anna 0 3,133 Feb-27-2018, 11:10 AM
Last Post: anna
  working code, suggestion required for improvement anna 18 8,846 Dec-29-2017, 01:24 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020