'How to print a random element from a list on to excel file rows on openpyxl

I'm quite new to programming. I have been trying to print a random element from the following list:

senior_duties = ["SOPs", "EQA review", "Doc review", "NC review", "Trend analysis"]

I have tried this

import random

rand_senior_duties = print(random.choice(senior_duties))

Then I assigned rand_senior_duties to the cells like this:

sheet["D5"] = rand_senior_duties

However it only prints to the console and not the actual sheet.

Any help will be appreciated. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source