0
Ok give indentation correction. The and for the above pgm is in this link
4 Respuestas
+ 1
At First :
after a
'class String:'
Everything in the class has to be indented. So shift every line 2 Times to the right.
And you have also to intent after a "for" and after "if"
+ 1
In line 21 and 25 the
'l' and 'L'
has to be changed to
'u' and 'U'
+ 1
Personally, I would prefer to take out all input and output Funktion from the class.
And maybe a separat return for each Methode. In the main program it looks like this.
instr = Input()
s = String()
s.setString(instr)
upper = s.count_upper()
lower = s.count_lower()
.
.
print ('upper =', upper)
and so on
0
This one is NOT ready.
But you can see how it works. And have a look at the Intention 😉
https://code.sololearn.com/cV8jFKSyH7Zk/?ref=app