Navbar menu
(Move to ...)
Home
Python
HTML
JavaScript
Quiz
AS400 / IBM iSeries
Contact Us
▼
Python program to Create a list of the first 15 even numbers that are not divisible by 6
Create a list of first 15 even numbers that are not divisible by 6 using for loop
Code Snippet:
ans =[]*15 for i in range (2,100,2): if i%6 != 0 and len(ans) < 15: ans.append(i) print("List of first 15 even numbers that are not divisble by 6:\n",ans)
Copy
Output:
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment