Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Created October 6, 2019 09:15
Show Gist options
  • Select an option

  • Save ChaitanyaBaweja/45904534a4fd7151bb106c3a73cb6ede to your computer and use it in GitHub Desktop.

Select an option

Save ChaitanyaBaweja/45904534a4fd7151bb106c3a73cb6ede to your computer and use it in GitHub Desktop.
# Multiplying each element in a list by 2
original_list = [1,2,3,4]
new_list = [2*x for x in original_list]
print(new_list)
# [2,4,6,8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment