Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Jun 3, 2021
Embed
What would you like to do?
a = range(1,21)
for i in a:
if i % 2 ==0:
i = i*2 # Even Number will be multiplied with 2
else:
i = i*i # Odd number will be squared
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment