#Exercise 4 : Reverse a string
string = input("Enter a string input")
string_list = []
reversed_list = []
for alphabets in string:
string_list.append(alphabets)
print(string_list.reverse())
Question:
Why is the output 'None' and not the reversed list itself?
#Exercise 4 : Reverse a string
string = input("Enter a string input")
string_list = []
reversed_list = []
for alphabets in string:
string_list.append(alphabets)
reversed_string = string_list.reverse()
print(reversed_string)
Я попытался назначить переменную «reversed_string» для «string_list.reverse()» и распечатать ее, но все равно получил «Нет».
[code]#Exercise 4 : Reverse a string string = input("Enter a string input") string_list = [] reversed_list = []
for alphabets in string: string_list.append(alphabets)
print(string_list.reverse())
Question: Why is the output 'None' and not the reversed list itself?
#Exercise 4 : Reverse a string string = input("Enter a string input") string_list = [] reversed_list = []
for alphabets in string: string_list.append(alphabets)
reversed_string = string_list.reverse() print(reversed_string) [/code] Я попытался назначить переменную «reversed_string» для «string_list.reverse()» и распечатать ее, но все равно получил «Нет».