Skip to content

Instantly share code, notes, and snippets.

@mayankdawar
Last active September 21, 2022 19:52
Show Gist options
  • Select an option

  • Save mayankdawar/bc7d4fc0207e9575efaafbbc1b42e4c8 to your computer and use it in GitHub Desktop.

Select an option

Save mayankdawar/bc7d4fc0207e9575efaafbbc1b42e4c8 to your computer and use it in GitHub Desktop.
Currently there is a string called str1. Write code to create a list called chars which should contain the characters from str1. Each character in str1 should be its own element in the list chars.
str1 = "I love python"
chars = []
for i in str1:
chars.append(i)
@Mehabub1629
Copy link

str1 = "I love python"
chars = []
for i in str1:
chars.append(i)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment