Whats the output of "for i in "hello world": print(i)" and why/how is this achieved

output is: "h", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d" each character being printed in a new lineA "for" loop is used to itterate over a string "hello world" and print each character, this works by "moving" variable "i" along the string, giving it a different character per every iteration of a loop and then asking to print the value its currently holding

Related Python Mentoring answers

All answers ▸

What is Object-Oriented Programming?


Whats is the difference between a function and a procedure?


What are docstrings and how do I use them to improve my code readability?


Define a function that takes in the age of the user and adds it to an output sentence such as "You are ..... old".