Answer to Question #249868 in Python for lastone

Question #249868
import time
nucleotides="ATGC"
nulength= len(nucleotides)
nucleostring=""
noofbase=0
inputbase= int(input("Enter the number of base: "))
while noofbase < inputbase:
rand=int(time.time_ns())
randomno=rand%nulength
nucleostring+=nucleotides[randomno]
noofbase+=1
print(nucleostring)
print("Forward: ")
print("DNA Seq")
if len(nucleostring)%3 == 0:
for i in range(0, len(nucleostring),3):
c= nucleostring[i: i+3]
print(c)
but i need output in horizontal line
output Enter the number of base: 6
TACGCTTCTCGTGCCTCCTCCGCTGCGATCCAACCA
Forward:
DNA Seq
TAC
GCT
1
Expert's answer
2021-10-12T00:36:27-0400
import time


nucleotides="ATGC"


nulength= len(nucleotides)


nucleostring=""


noofbase=0
inputbase= int(input("Enter the number of base: "))


while noofbase < inputbase:
    rand=int(time.time_ns())
    randomno=rand%nulength
    nucleostring+=nucleotides[randomno]
    noofbase+=1
print(nucleostring)
print("Forward: ")
print("DNA Seq")


if len(nucleostring)%3 == 0:
    for i in range(0, len(nucleostring),3):
        c= nucleostring[i:i+3]
        print(c)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS