Python Forum
Python for loops giving error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python for loops giving error
#8
(Jan-08-2019, 11:58 AM)perfringo Wrote: I am not familiar with biopython at all. I was able to find description of Bio.SeqIO.parse. According to documentation: "Turn a sequence file into an iterator returning SeqRecords.". I have no idea what format 'fasta' files are or what is the content of 'protein.fasta' or what SeqRecord is.

However, you wrote:

"These answers were right" / "Then I tried to multiply all the list elements together"

You just wrap your 'right answers' into function and you will get product of said list:

print(sequence_product(right_answers))

I tried it like this :
[python]sequence_productx(combinations)/python]

and this gives 32768 as an answer.
Which is correct for the last list combination but the other 4 are not printed out.
Reply


Messages In This Thread
Python for loops giving error - by Petrus - Jan-07-2019, 10:01 PM
RE: Python for loops giving error - by xhughesey - Jan-07-2019, 10:18 PM
RE: Python for loops giving error - by Petrus - Jan-07-2019, 10:56 PM
RE: Python for loops giving error - by perfringo - Jan-08-2019, 05:37 AM
RE: Python for loops giving error - by Petrus - Jan-08-2019, 10:23 AM
RE: Python for loops giving error - by Petrus - Jan-08-2019, 11:38 AM
RE: Python for loops giving error - by perfringo - Jan-08-2019, 11:58 AM
RE: Python for loops giving error - by Petrus - Jan-08-2019, 12:29 PM
RE: Python for loops giving error - by perfringo - Jan-08-2019, 12:48 PM
RE: Python for loops giving error - by Petrus - Jan-08-2019, 01:24 PM
RE: Python for loops giving error - by perfringo - Jan-08-2019, 01:48 PM
RE: Python for loops giving error - by Petrus - Jan-08-2019, 02:27 PM
RE: Python for loops giving error - by Petrus - Jan-09-2019, 08:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  New to python! Loops Seeley307 3 62,138 May-15-2020, 02:27 PM
Last Post: ibreeden
  Error in loops, new to Python jhall710 20 12,396 Apr-25-2017, 05:18 AM
Last Post: smbx33

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020