Initial commit: Python learning project with examples and exercises
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#7.1.3
|
||||
list1 = input().split(' ')
|
||||
print(list1)
|
||||
list2 = []
|
||||
for i in list1:
|
||||
if '2'<=i<='5':
|
||||
list2.append(i)
|
||||
print(list2)
|
||||
str1 = '-'.join(list2)
|
||||
print(str1)
|
||||
|
||||
txt1 = open('7.1.3.txt',"w")
|
||||
txt1.write(str1 + '\n')
|
||||
txt1.writelines(list2)
|
||||
txt1.close()
|
||||
Reference in New Issue
Block a user