New course! Every coder should learn Generative AI!
Try a free lesson+ 2
This when it finds o it will print b the same number of times.
o = ("o", "b", "b", "o")
i = 0
while i < len(o):
if o [i] == 'o':
print('b')
i += 1
https://sololearn.com/compiler-playground/ckmfvhyyDzr7/?ref=app
+ 1
If you are referring to Optical Character Recognition, my first bet would be on PyTesseract, a wrapper for the popular Google Tesseract OCR engine (and no, it thankfully does not need an internet connection). I assume you don’t actually want to make the OCR engine yourself, just use it in Python?
+ 1
Does it have to be a tuple and a while loop?
+ 1
Valentina JUMP_LINK__&&__Python__&&__JUMP_LINK maybe you would prefer using something else like import re and using findall()
https://sololearn.com/compiler-playground/ceX3jbpwcNju/?ref=app
0
Je ne suis pas sûr de ce que ce code est censé faire. Essayez-vous de compter le nombre de fois que la lettre O apparaît dans une liste ?
De plus, cette traduction automatique vous aide-t-elle ?
0
Valentina JUMP_LINK__&&__Python__&&__JUMP_LINK If you likes BroFar example I created something similar with out RegEx. My code uses a simple for loop. To find the string 'o' and display how many times it is found.
Updated code:
https://sololearn.com/compiler-playground/ckmfvhyyDzr7/?ref=app