46 exercises: 11-15

It has been a long time since I made a post about the 46 Python exercises, which I started in quiz #5 and quiz # 6, so here I am going to show the next five.

Problem eleven was about using a number n and a character c to generate a string of cs  n times. For example, if n = 3 and c = a, the answer should be “aaa”.

I did my code like this:

11

And it ran like this:

11run

The next problem was about taking a list of integers and creating its histogram:

1212run

Exercise 13 consisted on returning the maximum value of a list of numbers. For this, I used Python´s max() method.

1313run

The following one was about taking a list of integers and returning a list of their lengths:

1414run

Finally, in exercise 15 I had to make a program that would take a list of words and return the length of the longest one:

15 15run

And that’s it for now, I’ll be showing the rest of the problems I have made in other posts! ❤

 

One thought on “46 exercises: 11-15

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s