Skip to content

PierreGir/Foodles---first-exercice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

  1. Write a function that takes as input (sentence: String, n: Number) and returns a list of size n where each element contains a word and and the frequency of that word in sentence This list should be sorted by decreasing frequency and alphabetical order in case of tie.

Example: Input: ("bar baz foo foo zblah zblah zblah baz toto bar", 3) Output: [ ("zblah", 3), ("bar", 2), ("baz", 2), ]

  1. Write tests for the function you just wrote

Requirements

To run the tests, you need to install pytest like so :

pip install pytest

and then run the tests using the command :

pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages