I'm learning python 3 and I'm having problems with string related excerises. One exericse I'm working on is to write a program that cycle through a string and dispaly it like this:
s u p e r n a t u r a l
u p e r n a t u r a l s
p e r n a t u r a l s u
# This my code so far:
def main():
first_Name = "s u p e r n a t u r a l"
for i in range(0,len(first_Name), 2):
print(first_Name[i:], first_Name)
main()
When I code my code the output is this:
s u p e r n a t u r a l s u p e r n a t u r a l
u p e r n a t u r a l s u p e r n a t u r a l
p e r n a t u r a l s u p e r n a t u r a l
e r n a t u r a l s u p e r n a t u r a l
r n a t u r a l s u p e r n a t u r a l
n a t u r a l s u p e r n a t u r a l
a t u r a l s u p e r n a t u r a l
t u r a l s u p e r n a t u r a l
u r a l s u p e r n a t u r a l
r a l s u p e r n a t u r a l
a l s u p e r n a t u r a l
l s u p e r n a t u r a l
Is another for loop needed?