This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = input('введите слово ') | |
i = 0 | |
while i < len(x): | |
if i % 2 == 0: | |
print(x[i]) | |
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = input('введите слово ') | |
i = 1 | |
while i <= len(x): | |
if i % 2 == 0: | |
print(x[i-1]) | |
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = input('введите слово: ') | |
for number, character in enumerate(x, start=1): | |
if number % 2 == 0: | |
print(character) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
userinput = input('Please, type any word. It will be reduced by 2 characters from begin and from end: ') | |
if userinput: | |
print('Result is:') | |
print(userinput[2:-2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('#### Welcome to word cuter 1.0! #####') | |
while True: | |
userinput = input('Please, type any word. It will be reduced by 2 characters from begin and from end: ') | |
if userinput.upper() == 'EXIT': | |
print('You entered /exit/ . Closing application') | |
break | |
elif userinput != '': | |
print('Result is:') | |
print(userinput[2:-2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onumber = 8 | |
results = [onumber] | |
counter = onumber | |
while counter != 0: | |
print(' '.join([str(i) for i in results])) | |
counter -= 1 | |
results.append(counter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = input('type a number') | |
onumber = int(x) | |
results = [onumber] | |
counter = onumber | |
while counter != 0: | |
print(*results) | |
counter -= 1 | |
results.append(counter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = int(input('Enter number')) | |
result = str(x) | |
i = x | |
while i != 0: | |
if i !=x: | |
result = result + ' ' + str(i) | |
print(result) | |
i -= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = int(input('enter number')) | |
result = str(x) | |
for i in range(1, x): | |
result = result + ' ' + str(x - i) | |
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = int(input('enter number')) | |
result = str(x) | |
for i in range(x): | |
if i == 0: | |
continue | |
result = result + ' ' + str(x - i) | |
print(result) |
OlderNewer