Skip to content
Advertisement

Tag: python-3.x

Find all the minimal values on a list

I have a list of tuples. Each tuple’s element 0 is a numeric value. I want to find all the tuples with the minimal value in element 0. For example: would give me what I want: My question is (could be three different answers): what is the Code Golf/fastest/most Pythonic way to do this? Answer Here’s a solution using min.

What is the process of this code, and why is the answer 1?

I am having my first ever Python exam this Monday, and am naturally very nervous! I am currently going through some old exams and this question appeared: “What result of the following code will appear on the terminal?” I tested it, and the answer is 1. However, I can’t seem to wrap my head around why. If anyone would be

How to attach mulitple files in PDF?

I have a list of objects: List = [‘Doc1.xlsx’,’Doc2.csv’,’Doc3.pdf’] and a list of their names: List1 = [‘Doc1_name.xlsx’,’Doc2_name.csv’,’Doc3_name.pdf’]. I need to attach them in existing PDF. I tried with the folowing code, which works only if I have one attachement. Now I am trying to iterate over the attachements to attach all of them but in the Final.pdf will be

Advertisement