How can I use method replece on python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I use method replece on python?

I want to show the next output, for example, I have variable = travel, I want it to show me t,r,a,v,e,l Help, please!!

9th Nov 2020, 8:46 AM
Julio Carrillo
3 Answers
+ 3
Whilst I agree with Lothar about the importance of posting your attempt, I also remember my own struggles learning this concept. So: variable = 'travel' print(variable.replace('',',')) As you can see, your variable is followed by the method with 2 arguments. The 2nd argument replaces the first argument
9th Nov 2020, 10:46 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 9
Julio Carrillo , to get help from the community, you should have done a try by yourself first. Please put your code in playground and link it here. Thanks!
9th Nov 2020, 9:47 AM
Lothar
Lothar - avatar
0
https://code.sololearn.com/cJ2HeN6PuiTG/?ref=app How do I have to do in this case? Because I have two variable.
9th Nov 2020, 5:52 PM
Julio Carrillo