Python Forum
I need Help in this problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need Help in this problem
#1
hello guys ,
actually I need some help to solve this problem by bython :

Assume s is a string of lower case characters.

Write a program that prints the number of times the string 'bob' occurs in s. For example, if s = 'azcbobobegghakl', then your program should print


but I need to solve this problem with for or while loops or both of them

I am a new learner of bython
and I've spent much time solving it but the output is always wrong

Reply
#2
What have you tried? We are glad to help, but we are not here to do your homework for you.
Please, post your code (in code tags) and ask specific questions. Don't forget to include the full traceback (in error tags) if you get one.
Reply
#3
Do you really mean bython rather than python?

The former is a non-standard implementation of python using braces {} instead of indentation to provide syntax information.

Alternatively, bython is the name of a company that does a number of things including providing training.

python uses indentation:

name = 'gruntfutuk'
for character in name:
  if character == "u":
    print("wow, a 'u' ")
  else:
    print(character)
I am trying to help you, really, even if it doesn't always seem that way
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020