This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dna = input() | |
out = "" | |
for i in dna: | |
if i == "A":out+="T" | |
if i == "C":out+="G" | |
if i == "G":out+="C" | |
if i == "T":out+="A" | |
print(out) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s=input() | |
a=s.count("A") | |
b=s.count("C") | |
c=s.count("G") | |
d=s.count("T") | |
print(str(a) + " " + str(b) + " " + str(c) + " " + str(d)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(''.join(c.lower() if c.isupper() else c.upper() for c in input())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
start = int(input()) | |
end = int(input()) | |
amount = int(input()) - 1 | |
if amount == -1 and start == 0 and end == 0: | |
print("NONE") | |
else: | |
difference = end-start | |
step = difference/amount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
line = input() | |
if len(line)%3 == 0: | |
n=3 | |
c="" | |
for i in [line[i:i+n] for i in range(0, len(line), n)]: | |
c+=chr(int(i)) | |
print(c) | |
else: | |
print("ERROR") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p,a,c="n",[],"" | |
for i in "2ab4g9cat": | |
if i in "0123456789": | |
if p=="n":c+=i | |
else:a.append(c);c,p=""+i,"n" | |
else: | |
if p=="a":c+=i | |
else:a.append(c);c,p=""+i,"a" | |
a.append(c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
past="" | |
amount = 0 | |
n = input() | |
past=n[0] | |
system = [] | |
for i in n: | |
if i == past: | |
amount+=1 | |
else: | |
system.append(str(amount) + past) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input();print(sum([int(i)**2 for i in input().split()])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(min(int(input()),int(input()))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double=0 | |
for i in input().split(): | |
past = "" | |
for char in i: | |
if char.lower() == past.lower(): | |
double+=1 | |
break | |
else: | |
past = char | |
print(double) |