+ 6
[Challenge]String shortener
Taking a string and an integer as an argument build a program that make the string short with "..." at the end of it. And the formatted string's length should be the int arg that provided eg: input:- sololearn is great 14 output:- sololearn is...
9 Respostas
+ 9
Python:
print(input()[:int(input())] + "...")
https://code.sololearn.com/cyJtJ8WfEtOF/?ref=app
+ 3
My try, very basic..
https://code.sololearn.com/c7kPXL3aKx7J/?ref=app
+ 3
First Challenge I took on, also I'm not too sure how people post their code but I hope this works:
https://code.sololearn.com/c8NAiz5Xp6Ed/#py
+ 3
https://code.sololearn.com/clwhknDF2GQK/?ref=app
+ 1
Javascript:
const shortener = (s,n) => s.substr(0,n) + '...';
alert(shortener('sololearn is great', 12));
https://code.sololearn.com/WWqZXyGe58xS/?ref=app
+ 1
Арман Арманов я не знаю
+ 1
Python that can handle exceptions:
https://code.sololearn.com/cdu52npWkN4C
0
очем они толкуют?
0
Thank you all for commenting here.
Here is my try in Java
https://code.sololearn.com/c24I2Pq1eim0/?ref=app