Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9120679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:40:42+00:00 2026-06-17T05:40:42+00:00

I need help in how to identify a character from the user input? And

  • 0

I need help in how to identify a character from the user input? And how to replace with specific character of my own.

The Task:

  1. This program prompts the user to enter a DNA sequence (A,T,C,G) and display the reverse complement of that DNA sequence

  2. The program should only accept the DNA bases (A,T,C,G) uppercase letter only, if not, convert the character to ‘x’

My problem is in the second step of the program, in how to replace the letters that are not upper-cased (A,C,G,T) with ‘x’ character

seq= input('Enter a DNA sequence ')

seqcom = {'A':'T','C':'G','T':'A','G':'C'} # dictionary 

letters = list(seq)
letters.reverse ()
dna =''

for base in letters:
    dna += seqcom[base]


print('The reverse complement of \n', seq, '\n', 'is\n', dna)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:40:43+00:00Added an answer on June 17, 2026 at 5:40 am

    You want: dict.get(key[, default])

    for base in letters:
        dna += seqcom.get(base, 'x')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need help writing a script downloads data from google insight using c# this is
I need help to identify the bug in my program that I have written
I need help with one ajax function This is raw page setup. Page will
I am looking for a specific regular expression that will help me identify if
I need help in understanding git rebase for this situation. I checked out a
I need help to discover how to identify how many host addresses are available
I need some help figuring out the regex for XML character references to control
I'm creating this cool HTML Jeopardy game and I need a little coding help.
Can someone help me identify what the purpose of this unidentified syntax is. It
Need help, function getFamily() { FB.api('/me/family', function(response) { alert(JSON.stringify(response)); }); } With the above

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.