You are not logged in. Please login at www.codechef.com to post your questions!

×

What is the function of count in pyhthon 3.5?

Help me out!!!

asked 20 Jun, 16:33

mdrzwan12's gravatar image

0★mdrzwan12
11
accept rate: 0%


The function, as the name itself indicates, counts the number of occurances of a string in another string.

For example:

s = 'abbabb'
c1, c2 = s.count('a'), s.count('b')
print(c1)
print(c2)

It should print "2\n4" ('\n' is 'newline'); because there are 2 'a's and 4 'b's in the string 's'

link

answered 20 Jun, 16:47

sarthakmanna's gravatar image

6★sarthakmanna
915115
accept rate: 35%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×294

question asked: 20 Jun, 16:33

question was seen: 56 times

last updated: 20 Jun, 16:47