Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ecbee07

Browse files
sales by match
1 parent cf52066 commit ecbee07

File tree

3 files changed

+83
-344
lines changed

3 files changed

+83
-344
lines changed

‎Warm-up Challenges/.ipynb_checkpoints/Warm-up Challenges-checkpoint.ipynb

Lines changed: 0 additions & 344 deletions
This file was deleted.

‎Warm-up Challenges/Repeated String.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
#
10+
# Complete the 'repeatedString' function below.
11+
#
12+
# The function is expected to return a LONG_INTEGER.
13+
# The function accepts following parameters:
14+
# 1. STRING s
15+
# 2. LONG_INTEGER n
16+
#
17+
18+
def repeatedString(s, n):
19+
# Write your code here
20+
c = 0
21+
for i in range(n):
22+
if (s*n)[i] == 'a':
23+
c += 1
24+
return c
25+
26+
if __name__ == '__main__':
27+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
28+
29+
s = input()
30+
31+
n = int(input().strip())
32+
33+
result = repeatedString(s, n)
34+
35+
fptr.write(str(result) + '\n')
36+
37+
fptr.close()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /