Coding question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Coding question

Name = input('Enter name:') Surname = input('Enter surname:') Title = input("Enter title:") print('Person is:{0:.4s}. {1:s} {2:.1s}.'.format(Title,Surname,Name)) This should appear like this Person is: Prof.Dogrmaci, I. But the last initial in it is not appearing, what’s the reason ?

2nd Oct 2020, 11:43 AM
Zami Gaming
Zami Gaming - avatar
3 Answers
+ 1
print('Person is:{0:.4s}. {1:}, {2:.1s}.'.format(Title,Surname,Name))
2nd Oct 2020, 11:55 AM
Jayakrishna 🇮🇳
0
thank you it worked! what was my mistake?
2nd Oct 2020, 12:11 PM
Zami Gaming
Zami Gaming - avatar
0
I edited to {1:s} to {1:}. But actually yours also working.. Check again.. May you actually adding like 1:.s..? {1:} output total surname..
2nd Oct 2020, 12:21 PM
Jayakrishna 🇮🇳