256 Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the output for list[1]? import re Seq = 'ACTGAACTGAAACTGAAAA'list = re.findall('AA*', Seq)print(list[2])

'AAA'

What is the result of this code? list = [['AAA', 'TTT', 'GGG'] , ['ATC', 'GCT', 'CAT'], ['CTG', 'ACT', 'CTG', 'GCA'], 'TGCGG'] print(list[1][2])

'CAT'

Which pattern would NOT match "123!456!"?

(\D+\s?)+

What is the highest number output by this code? def print_nums(x): for i in range(x): print(i)return print_nums(10)

0

What is the output of the following code? def function(variable): variable += 1 return variable variable = 1 function(7) print(variable)

1

What is the result of this code? def timesTwoFour(a, b=2): two = a * 2four = b * 4 return two, four y, z = timesTwoFour(5) print(y, z)

108

What is the result of this code? i = 1for x in range(4, 7, 2): i = i + x print(i)

11

What is the result of this code? nums = [9, 8, 7, 6, 5] nums.append(4) nums.insert(2, 11) print(nums[2])

11

What is the result of this code? for i in range(10): if not i % 2 == 0: print(i + 1, end=' ')

2 4 6 8 10

What is the correct order to declare a function say Hi() and call it? 1. sayHi() 2. return("Hi!") 3. def sayHi()

321

Which variable name is NOT legal in python?

5prime_end

Which option is output by this code? >>> (5 + 7) / 2

6.0

What is the output of this code? >>> spam = "7" >>> spam = spam + "0" >>> eggs = int(spam) + 3 >>> print(float(eggs))

73.0

Which repeated character can match zero or one repetitions of the previous thing?

?

Which string would NOT be matched by "^ATG[^N]*TGA$"?

ATGNNNTGA

What would [1-5][0-9] match?

Any two-digit number from 10 to 59

What is the output for the following python script? DNA="ATGC" print(DNA[::-2])

CT

What is the output of the following code? class test: def __init__(self,a="Class and Object"): self.a=adef display(self): print(self.a) obj=test() obj.display()

Class and Object

What is Python Enhancement Proposal (PEP) 8?

Guidelines for writing code

Which function in Biopython is used to parse the BLAST result in XML format for a file with a single query?

NCBIXML.read()

What is the output of this code? >>> spam = "eggs" >>> print(spam * 3)

eggseggseggs

After executing the SQL database, the result is inside the cursor object. Which function can be used to access the content of the database?

fetchall()

Which line of code writes "Hello world!" to a file?

file.write("Hello world!")

How to extract the sequence names of the FASTA file "Maize_reference_genome.fasta"?

grep ">" Maize_reference_genome.fasta > Maize_reference_genome_name

Which module prints the Zen of Python when imported?

import this

How would you close a file stored in a VARIABLE "inputFile"?

inputFile.close()

What is the correct way to assign a value to a variable named num in python?

num = 3

Suppose you have a job script named "myjob.pbs", and you want to submit this job to the RedHawk cluster. Write down the command that you can use to submit this job script "myjob.pbs" to the RedHawk cluster?

qsub myjob.pbs

How would you refer to the randint function if it was imported like this? from random import randint as rnd_int

rnd_int

Which of these is the same as the metacharacter '+'?

{1,}


Ensembles d'études connexes

Chapter 1 - Module 2: Sections 1.03-1.04 Dynamic Study Module

View Set

4.2-Change Active Voice to Passive Voice

View Set

Digital Library Development Tech Terms

View Set

Net Present Value and Other Investment Criteria

View Set