Python 96
[Python 100] Python 100
(Python 2.0+)
#!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
str1 = raw_input(':\n')
str2 = raw_input(':\n')
ncount = str1.count(str2)
print ncount
: www.runoob.com : runoob 1
[Python 100] Python 100
MLee
221***[email protected]
Python3
#!/usr/bin/python3 if __name__ == "__main__": str1 = input(":") str2 = input(": ") print(str1.count(str2))MLee
221***[email protected]