Question
python: Write a function called findUserName that displays a suggested username based on a persons first name, last name, and a random number between 1-5
python:
Write a function called findUserName that displays a suggested username based on a persons first name, last name, and a random number between 1-5 given as a single string randomNumber firstname lastname (each separated by a single space, may contains both upper and lower case letters).
The result should be the persons first name initial in uppercase, followed by the last name (all the letters in lower) and the multiplication of random number and number of characters of the last name.
Note: Steps of findUserName function can be given as follows:
def findUserName (s): 1. Separate random number, first name and last name from string s 2. upperFirstInitial = First letter of the first name in uppercase. 3. lowerLast = Lowercase last name 4. num = Integer value of random number * Number of characters of last name 5. Concatenate the substring in the order, upperFirstInitial, lowerLast and string value of num and display the result.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started