Problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem

How create a program which recognise letters o

24th Apr 2024, 12:40 AM
Valentina Python
Valentina Python - avatar
13 Answers
+ 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
25th Apr 2024, 12:53 AM
Chris Coder
Chris Coder - avatar
+ 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?
24th Apr 2024, 12:46 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
Does it have to be a tuple and a while loop?
24th Apr 2024, 3:00 AM
Chris Coder
Chris Coder - avatar
+ 1
Thanks Chris Coder but I would like to find myself lol 😭😂
25th Apr 2024, 12:56 AM
Valentina Python
Valentina Python - avatar
+ 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
25th Apr 2024, 2:11 AM
BroFar
BroFar - avatar
+ 1
BroFar thanks for your answer 👍
25th Apr 2024, 2:13 AM
Valentina Python
Valentina Python - avatar
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
24th Apr 2024, 12:53 AM
Valentina Python
Valentina Python - avatar
24th Apr 2024, 12:57 AM
Valentina Python
Valentina Python - avatar
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 ?
24th Apr 2024, 1:15 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
No not necessarily
24th Apr 2024, 11:53 PM
Valentina Python
Valentina Python - avatar
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 ??
24th Apr 2024, 11:55 PM
Valentina Python
Valentina Python - avatar
25th Apr 2024, 2:31 AM
Chris Coder
Chris Coder - avatar
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
25th Apr 2024, 2:46 AM
Chris Coder
Chris Coder - avatar