Skip to content

Instantly share code, notes, and snippets.

View Xotabu4's full-sized avatar
🇺🇦

Oleksandr Khotemskyi Xotabu4

🇺🇦
View GitHub Profile
x = input('введите слово ')
i = 0
while i < len(x):
if i % 2 == 0:
print(x[i])
i += 1
x = input('введите слово ')
i = 1
while i <= len(x):
if i % 2 == 0:
print(x[i-1])
i += 1
@Xotabu4
Xotabu4 / word3.py
Last active January 31, 2016 15:02
x = input('введите слово: ')
for number, character in enumerate(x, start=1):
if number % 2 == 0:
print(character)
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])
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])
onumber = 8
results = [onumber]
counter = onumber
while counter != 0:
print(' '.join([str(i) for i in results]))
counter -= 1
results.append(counter)
x = input('type a number')
onumber = int(x)
results = [onumber]
counter = onumber
while counter != 0:
print(*results)
counter -= 1
results.append(counter)
x = int(input('Enter number'))
result = str(x)
i = x
while i != 0:
if i !=x:
result = result + ' ' + str(i)
print(result)
i -= 1
x = int(input('enter number'))
result = str(x)
for i in range(1, x):
result = result + ' ' + str(x - i)
print(result)
x = int(input('enter number'))
result = str(x)
for i in range(x):
if i == 0:
continue
result = result + ' ' + str(x - i)
print(result)