Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created June 3, 2021 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/627f88b38d7f4b6fb7ca806d1c871b63 to your computer and use it in GitHub Desktop.
Save amankharwal/627f88b38d7f4b6fb7ca806d1c871b63 to your computer and use it in GitHub Desktop.
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