+ 5
[ASSIGNMENT] ***** CHALLENGE #2 *****
String and length Task: Write a program to print a string and it's length in a single line of code without using length() function
19 Answers
+ 13
use .length , in place of .length()
//after converting to array đ
+ 10
+ 7
thanks..
+ 6
My solution you can say onelinerÂż 100% free of length() functions.
https://code.sololearn.com/cgPNuEso4TtS/?ref=app
+ 5
Please utilize the lesson-factory when creating challenges.
Thanks.
+ 4
guys i was expecting for 1 liner but nice try
and yes i did submit this as lesson
+ 4
C: unsigned len = sizeof(c_str)-1;
Where c_str is a character array.
+ 4
#python..
a=input();print(a,sum([a.count(i) for i in set(a)]))
+ 3
I wasn't completely sure I'd be successful, but it looks like I was! But I'll let you be the judge.
https://code.sololearn.com/cTtblsdRqEi5/#java
Bonus: You can enter multiple strings and get their lengths, not just one string.
Of course, challenges should be put in as lessons, now.
https://www.sololearn.com/Discuss/1082512/suggestion-challenge-assignment-creation
+ 3
Python strings have .__len__() magical method ;)
+ 2
your code was really good @swim
+ 2
good job @käzÎ
+ 2
guys thanks for participating
This is my try in c
https://code.sololearn.com/cNto905PR1Tb/?ref=app
0
i did @cipherfox
but they are not approved yet