Q:

user input select folder from a directory

I am a Python novice and I am trying to write a program that asks the user to select a file from a folder. I am able to list the folders for the user to select but am unsure how to proceed. I don't know whether to use if and elif to give options for the folders or if there is another way to proceed. 
I have asked for user input to select a folder. I am not sure what to add next. Any input is appreciated.
>>> >>> os.listdir('C:\\Users\\Anonymous\\Desktop\\Test')
['1', '2', '3', '4', '5']
>>> choice = input("Please select a folder number: ")

The actual result would have the user select the folder number and then have the program list the contents of the file. For example, the folder 1 contains a folder named "Hello" and another folder named "World"

A:

Once you have the choice from the user, you can start by forming the full path of the file you want to read using os.path.join
import os

folder_path = "C:\\Users\\Anonymous\\Desktop\\Test"
os.listdir(folder_path)

choice = input("Please select a folder number: ")
file_path = os.path.join(folder_path, choice)

So if the choice is 1, file_path="C:\\Users\\Anonymous\\Desktop\\Test\1"
After that, just open the file and print out the contents.
with open(file_path, 'r') as fp:
    print(fp.readlines())

