- #1
ver_mathstats
- 260
- 21
- Homework Statement
- Let list1 and list2 be two given lists of integers. Write a Python code to create list3, the list whose elements are the elements of list1 which are prime numbers and do not belong to list2.
- Relevant Equations
- Python
Code:
list3=[]
for i in range (len(list1)):
list3.append(list1[i])
list3.append(list1[i]=!list2[i])
I was just wondering if I am on the right track with this question. I also am confused as to how to incorporate the prime number condition into my code. Thank you, any help is appreciated.