0

Anyone to help me understand the Text Analyzer, i can't get anything here.

def count_char(text, char): count = 0 for c in text: if c == char: count += 1 return count file = open("newfile.txt", "w") file.write("""Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcenfr fv orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabthu gb oernx gur ehyrf. Nygubhtu cenpgvpnyvgl orgnf chevgl. Reebef fubhyq arire cnff fvyragyl. Hayrff rkcyvpvgyl fvyraprq. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba bg thrff. Gurer fubhyq or bar-- naq cersrenoylbayl bar --boivbhf jnl gb qb vg. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Abj vf orggre guna arrire. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""") file.close() filename = "newfile.txt" with open(filename) a

3rd Mar 2022, 8:23 AM
David Mphande
David Mphande - avatar
1 Answer
+ 3
DAVID MPHANDE , the code you presented is not complete, since the number of characters we can use for a post is limited. i recommend you to use a python file to store the complete code and then link this file here. thanks!
3rd Mar 2022, 4:26 PM
Lothar
Lothar - avatar