Skip to content

lumc-python/functions_assignment

Repository files navigation

1. Multiplication

Write a Python function to multiply all the positive numbers in a list. The function should return that result.

2. Function updates

Write a python function that transforms all the positive numbers from a list and returns back True if it performed any action on the list and False otherwise.

3. Palindrome

Write a function that returns True if its argument is a palindrome and False otherwise. A palindrome is a word, number, phrase, or other sequence of characters which reads the same way backward as forward (e.g., madam, able was i ere i saw Elba, 10101, 90.09).

4. k-mer counting

1. Remember "Exercise 3" (Analyse a repeat structure) from yesterday's assignment?

  • Make a function from your implementation that, given a sequence, it returns a set with the unique substrings.
  • Make k as a default argument to the function.
  • Add a docstring to the function.

2. Make another function with the same arguments (sequence and k) that uses

a dictionary in the implementation with substring counts.

  • Use the substrings as dictionary keys.
  • Use the counts as dictionary values.
  • Have the function return the dictionary.
  • Add a docstring to the function.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages