FAQ Database Discussion Community


python 3.2 - find second smallest number in a list using recursion

python,recursion,python-3.2
So I need to find the second smallest number within a list of integers using recursion but I cannot for the life of me devise a way to do it. I can do it with to find smallest number using this: def smallest(int_list): if(len(int_list) == 1): return int_list[0] else: a...

Looping over parallel lists in python

list,for-loop,python-3.2
Im reading over an itunes library file. I scraped the artist names and songs and put them in parallel lists, one containing artist names and another containing artist songs. I would like to do this by using only lists artist_choice = input("Enter artist name: ") artist_names = [Logic, Kanye West,...

how do i increase the min and max on my number list?

python,python-3.2
I'm creating a game in python but I ran into trouble when creating the level system. ya see for her attack I created A list from 1(min) to 10(max) and for every level she gains I want the min and the max of the list to increase by 1 but...

Deleting specific files from a directory

file,delete,python-3.2
I am trying to delete all files from a directory apart from two (which will be erased, then re-written). One of these files, not to be deleted, contains the names of all files in the folder/directory (the other contains the number of files in the directory). I believe there (possibly?)...

Python difference between timezones

python,datetime,timezone,python-3.2
I have to create a code that can tell me the current time in any city (as a variable) and print the utc offset between that time and utc. I already have the following code which gives the current time and the offset from a timezone, but this timezone is...