Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)
How would I write the python script that prints numbers 30 through 100 by every ten but excludes a certain value like 50?

1 Answer

0 votes
by (36.8k points)

This will work:

excludedNumbers = [50]

for num in range(30, 101, 10):

    if num not in excludedNumbers:

        print(num)

Do check out data science with python certification to understand from scratch 

Browse Categories

...