adn.py

Created by schraf

Created on September 07, 2018

185 Bytes

Écrire une fonction “adn” qui admet en paramètre une chaine de caractères et renvoie “Brin ADN” si les caractères sont uniquement des A, T, C et G ou “Pas ADN” si d’autres lettres sont présentes.


def adn(brin):
  for c in brin:
      if c not in "ATCG":
          return "Pas ADN"
  return "Brin ADN"
  
# Ex : adn("ACGTAGTG") -> Brin ADN
# Ex : adn("AGTXAT") -> Pas ADN

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.