5 added 260 characters in body
source | link

Python 3, 53 51 50 49 bytes

Python 3, 53 51 50 49 46 bytes

['2'in str(n)or print(n)for n in range(1,101)]
[print(n)for n in range(1,101)if'2'not in str(n)]

Try it online!

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

Python 3, 53 51 50 49 bytes

[print(n)for n in range(1,101)if'2'not in str(n)]

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

Python 3, 53 51 50 49 46 bytes

['2'in str(n)or print(n)for n in range(1,101)]

Try it online!

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

4 added 4 characters in body
source | link

Python 3, 53 51 50 43 bytes

Python 3, 53 51 50 49 bytes

[n [print(n)for n in range(1,101)if'2'not in str(n)]

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

Python 3, 53 51 50 43 bytes

[n for n in range(1,101)if'2'not in str(n)]

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

Python 3, 53 51 50 49 bytes

[print(n)for n in range(1,101)if'2'not in str(n)]

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

3 added 40 characters in body
source | link

Python 3, 53 51 50 5043 bytes

print([n for n in range(1,101)if'2'not in str(n)])

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

Python 3, 53 51 50 bytes

print([n for n in range(1,101)if'2'not in str(n)])

Not the strongest language for this task, but I'm new to golfing.

Python 3, 53 51 50 43 bytes

[n for n in range(1,101)if'2'not in str(n)]

Not the strongest language for this task, but I'm new to golfing.

Thanks to the commenters for their tips!

2 added 2 characters in body
source | link
1
source | link