Skip to content

Instantly share code, notes, and snippets.

View tardonly's full-sized avatar
🏠
Working from home

Ram Pratap tardonly

🏠
Working from home
View GitHub Profile
@tardonly
tardonly / str_rvs.py
Created August 19, 2017 09:23
Reverse Word Order
a = input("enter line with apostrophe:")
a= a.split()
b=[]
for i in range(len(a)):
b.append(a[len(a)-i-1])
print(b)
@tardonly
tardonly / lst_rmv_dup.py
Created August 18, 2017 21:17
List Remove Duplicates
a=raw_input('enter list:')
a=eval(a)
b=[]
for i in a:
if i not in b:
b.append(i)
print(b)
@tardonly
tardonly / list_first_end
Created August 18, 2017 14:34
Exercise 12 solution
a=raw_input('enter list:')
a=eval(a)
if len(a)<=1:
print([a[0]])
else:
print([a[0],a[len(a)-1]])