Hey guys I need some help with a Python 36 coding assigment

Hey guys, I need some help with a Python 3.6 coding assigment, all of it is done except a the part where I have to make python determine and user id.

the instruction say this:

Combine the following 3 strings to determine the user id. You will use methods, operators, and string functions.

1: take the slice that starts at the position numbered by the length of the string integer divided by 3 and includes up to character 7.

2. take the last 3 letters in capitals.

3. take min and max,

So for example if user inputs name \"Albert Einstein\", the user id should be:

t EEIN t

Solution

as you said the logic for your question is

userid = \"Albert Einstein\"

##substring from length /3 to 7 which is a space but you have included E so i took till 8

first=userid[(int)(len(userid)/3):8]

##then last 3 characters in uppercase

second=userid[(int)(len(userid)-3):(int)(len(userid))].upper()

## then the min and max

third=min(userid)+max(userid)

print(first+second+third)

hope you understand it and if struck please comment

Good Luck!

Hey guys, I need some help with a Python 3.6 coding assigment, all of it is done except a the part where I have to make python determine and user id. the instru

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site