Q:

Building a FOR loop inside of a string that will be used to prompt the user for input

I am having a hard time solving what I think SHOULD be an easy problem. I have a dictionary that consists of a key(interger that represents an option #) and a value (string that is a description of the option). I need to print each key value pair on a separate line inside of the input function. 
file_codes = {2: 'iosFile',
              3: 'startup',
              4: 'running'}
host_ip = '10.10.10.10'
users_numeric_entry = int(input(f'Please pick a configuration to copy for: {host_ip}\n))

Input prompt should be like below:
Please pick a configuration to copy for: 10.10.10.10

2 - iosFile
3 - startup
4 - running
: 

I feel that I need a to create a for loop to iterate through the dictionary, but I am having a hard time coming up with the code to achieve my desired output. 

A:

I would print things out first, and then prompt with just :
print(f'Please pick a configuration to copy for: {host_ip}\n')
for k, v in file_codes.items():
    print(str(k) + ' - ' + v)
users_numeric_entry = int(input(':'))

If you are using python 2.x then dictionaries are not ordered and there is no guarantee it will print in the order you expect. In python 3.6+ they are ordered.

