+ 1

[SOLVED] End="" only able to move one output horizontally

My code: word = input("Enter a phrase:") findW = input("Enter a letter to find:") position="" for c,position in enumerate(word): if findW in position: ans = "~"+str(c) print(ans) print(findW,"Appeared at position:",end =" ") output: a Appeared at position: ~1 ~3 ~7 How do i move the -3 and -7 at the same position as the ~ 1? i always have problem with end"" :(

8th Jun 2018, 11:52 AM
Samantha philip
Samantha philip - avatar
2 Antworten
+ 2
print(ans, end='')
8th Jun 2018, 12:09 PM
Gopal Gautam
Gopal Gautam - avatar
+ 1
Lols, it works :/ , didnt know u can double end="" . Thanks Gopal
8th Jun 2018, 12:47 PM
Samantha philip
Samantha philip - avatar