Create a Python program that takes a sentence as an input and outputs all the words with their part of speech.
This is a sentence.
import nltk

sentence = 'This is a sentence.'
words = nltk.word_tokenize(sentence)

for word in words:
 print(f'{word}: {nltk.pos_tag([word])[0][1]}')