Copy responder link
Copy
Published
Section 1 of 2
Python basic level - Self-assessment
This quiz is meant for course participants to assess their knowledge level in Python.

IMPORTANT NOTE : regarding the usage of some functions from specific modules,
we do not necessarily ask that you are able to answer the questions off the top of your head. Rather, you should be able to provide an answer in a reasonable amount of time after a quick internet search, or a call to help(), to consult the documentation.

If you are not able to answer most of the questions correctly (less than 4 out of 6 correct answers), it is an indication that you may need to gain a deeper understanding of the corresponding topic(s) before you are able to fully benefit from the course.

Some pointers to self-study materials are given below, but note that there are plenty of other excellent materials available as well , this is by no means an exhaustive list.
- https://wiki.python.org/moin/BeginnersGuide/Programmers
- http://rosalind.info/problems/list-view/?location=python-village
- https://github.com/KingaS03/Introduction-to-Python-2020

Swiss Institute of Bioinformatics
Loading image…
Loading...
Loading…
Section 2 of 2
Questions
 
Which of the following commands is a valid call to the help the the len() function?
Question Type
Loading image…
len.help()
help(len())
help(len)
Add option
or
add "Other"
Answer key
(1 point)
Loading...
Loading…
Presume you have a dictionary called D. Which command would you use to add a new key 'A' with value 0 to D ?
Question Type
Loading image…
D[0]='A'
D['A']=0
D.add("A":0)
D.A=0
Add option
or
add "Other"
Answer key
(1 point)
Loading...
Loading…
What should the following Python code print:
Question Type
Loading image…
[1,2,3,4,5,6,7,8]
[0,9,36]
an error
[0,3,6]
[6,3,0]
Other:
Add option
Answer key
(1 point)
Loading...
Loading…
What should the following Python code print:
Question Type
Loading image…
5.0
5.830951894845301
an error
6.4031242374328485
Add option
or
add "Other"
Answer key
(1 point)
Loading...
Loading…
We want to open a file named myFile.txt, which is placed a subfolder named myFolder. What is the command to open this file for reading ?
Question Type
Loading image…
in = open( "myFolder/myFile.txt" , 'r' )
in = read.file("myFolder/myFile.txt")
in = open( "myFolder/myFile.txt" , 'w' )
in = open( "myFile.txt" , path = "myFolder" , 'r' )
Add option
or
add "Other"
Answer key
(1 point)
Loading...
Loading…
What should the following code print:

Question Type
Loading image…
0
720
120
15
21
Add option
or
add "Other"
Answer key
(1 point)
Loading...
Loading…
Link to Sheets
Insights
Total points distribution
Loading...
Loading responses…
Settings
Release grades
Respondent settings
Global quiz defaults
Default question point value
Point values for every new question
points
Responses
Manage how responses are collected and protected
Presentation
Manage how the form and responses are presented
Defaults
Form defaults
Settings applied to this form and new forms
Question defaults
Settings applied to all new questions
.