Nov-02-2020, 08:46 PM
I am curious to know if you are able to divide the len of a string to get a numeric value. I am trying to do this within a for loop. I have two outcomes to the code i would like to write.
1. prints symbols over the users name.
2. allows for a space between the symbols, while sticking to the length of the users name.
i was sable to use len for the symbols without a space.
....
KEYS
but with space between the symbols i would need half the spaces or characters.
I tried this but it was definitely wrong.
. .
KEYS
1. prints symbols over the users name.
2. allows for a space between the symbols, while sticking to the length of the users name.
i was sable to use len for the symbols without a space.
name="KEYS" symbol="." for i in range(1, len(name)+1, 1): print (symbol, end="") print("\n"+str(name))Output is
....
KEYS
but with space between the symbols i would need half the spaces or characters.
I tried this but it was definitely wrong.
for e in range(1, len(name)/2, 1): print (symbol, end=" ") print("\n"+(str(name)))trying to get an output of or something like
. .
KEYS