Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
Problem
How create a program which recognise letters o
13 ответов
+ 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
Thanks Chris Coder but I would like to find myself lol 😭😂
+ 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
+ 1
BroFar thanks for your answer 👍
0
Thanks for your answer sorry I have difficult to explain the problem my English is basic, yeah I use a list like that :
o = ("o","b","b","o")
while len(o) == 5:
o = o+1
If in o == int("b")
Print(b)
And I know,I maked many mistakes
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
No not necessarily
0
Wilbur Jaywright yes the traduction works but the only problem how can I begin the program with while ? I don't know or condition for if there is b in the list , print b I don't know if I explain well my problem and I would like to make ??
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