прошу прощения, я новичок и сразу начинаю новую тему, но мне очень нужна помощь
нам задали 5 задач, с 2мя у меня проблемы
два задания: 1.Read the string from the standart input. Print all groups of 2 characters which contain the same letter.
2. Using REMOVE delete all the odd numbers from the list.
задания простые, но есть условие:нельзя использовать import re для 1 и def для 2;
без regular expressions я даже список на группы разбить не смогу(полный noob), а 2 не работает.
не могли бы вы мне указать,в чем моя ошибка в задании 2 и что-нибудь посоветовать с 1
заране большое спасибо
print "Homework 2"
num_el=input("Enter the number of elements in the list: ")
new_li=[]
for x in range(num_el):
your_num=input("Add a number to the list: ")
new_li.append(your_num)
print "Your list includes: ", new_li
for i in new_li:
if new_li[i]%2==1:
new_li.remove(i)
print "Your new list is",new_li