Create a Python function that generates random numbers from 1 to 20 and appends them to a List.

Course work

Create a Python function that generates random numbers from 1 to 20 and appends them to a List.

Create a Python program to write the following list to a file called “ex2file.txt”.