Nov-11-2020, 08:08 AM
Hi I am two week new in python.
I have one assigment:
string = "3,9,13,4,42"
This string I should convert into a list[].
after that squared each element of list (entire list)
Than that squared list to convert to string again
string="9,81,169,16,1764" # that is output at the end
Till now i do this :
string = '3,9,13,4,42'
string.split()
string = string.split()
I do not know how to make for loop and put on square.
does annybody can give me instruction ,to learn something
Thank you
Peca
I have one assigment:
string = "3,9,13,4,42"
This string I should convert into a list[].
after that squared each element of list (entire list)
Than that squared list to convert to string again
string="9,81,169,16,1764" # that is output at the end
Till now i do this :
string = '3,9,13,4,42'
string.split()
string = string.split()
I do not know how to make for loop and put on square.
does annybody can give me instruction ,to learn something
Thank you
Peca