This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# origin: Programming+ exercise five-bugs
|
||||
# status: unverified; `corpus.py verify` checks it on the pinned compiler
|
||||
# probe: count the G and C bases in t; this version has mistakes to find by stepping
|
||||
# expect-stdout: 1
|
||||
def count_gc(t: String) -> Int:
|
||||
var total: Int = 0
|
||||
for i in range(t.count_codepoints() - 1):
|
||||
total = 0
|
||||
var b: String = String(t[codepoint=i])
|
||||
if b == "G" or b == "C":
|
||||
total += 1
|
||||
return total
|
||||
|
||||
|
||||
def main():
|
||||
print(count_gc("GATTACA"))
|
||||
Reference in new issue
Block a user