For num in range (2100 1) :
Prime=True
For I in range (2, num) :
If num % I==0:
Prime=False
Break
If prime:
Print (num)
CodePudding user response:
Directly append line
NewList=[]
For num in range (2100 1) :
Prime=True
For I in range (2, num) :
If num % I==0:
Prime=False
Break
If prime:
NewList. Append (num)
Print (newList)
CodePudding user response:
, put Numbers in the list of character type is OK,Upstairs code no problem