Commit 785a74f5 by likorn

Upload New File

parent a3dc1170
Showing with 31 additions and 0 deletions
list1 = []
print("Please write 5 lines")
for x in range(1, 6):
list1.append(input(str(x) + ' line: '))
to_remove = input("\nPlease tell us which line you want to remove\n")
list1.remove(to_remove)
to_front = input("\nNow write a line, we'll add it in front of the list\n")
list1.insert(0, to_front)
many_words = []
for x in range(0, len(list1)):
for letter in range(0, len(list1[x])):
if list1[x][letter] == ' ':
many_words.append(list1[x].split(' '))
break
print("\nNow we'll separate the lines with many words")
for y in range(0, len(many_words)):
for m in range(0, len(many_words[y])):
print(many_words[y][m])
string = ''
variable = input("Type something, please, we wanna store it\n")
reversed_var = [''] * len(variable)
for letter in range(0, len(variable) // 2):
temporary = variable[letter]
reversed_var[letter] = variable[len(variable) - 1 - letter]
reversed_var[len(variable) - 1 - letter] = temporary
print(string.join(reversed_var))
if len(variable) % 2 == 1:
reversed_var[len(variable) // 2] = variable[len(variable) // 2]
print(string.join(reversed_var))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment