What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-27 04:30:11
split one file into multiple files
##Write a Python program to create a file of numbers by taking input from the user. Split this file into two files where one file contains odd numbers and the other file contains even numbers from the file. You can take input of non-zero numbers, with an ... Add solution -
Python 2021-10-26 19:59:13
Write a Python program to read a file line by line store it into an array
def conftolist(fname,mode='r+'): with open(fname) as f: lines = [line.strip() for line in f] print(lines) conftolist('file1.txt') ############ with open('file1.txt','r+') as f: # li = list(f) # print(li) ls=[] for l in f: ls.append(l.strip())... Add solution -
Other 2021-10-19 21:54:02
python covert vtt subtittle to text txt file
import re bad_words = ['-->','</c>'] with open('example.en.vtt') as oldfile, open('newfile.txt', 'w') as newfile: for line in oldfile: if not any(bad_word in line for bad_word in bad_words): newfile.write(line) with o... Add solution -
Python 2021-10-19 09:38:10
trim string python
string =' abc ' # After removing leading whitespace print(string.lstrip()); # Output: 'abc ' # After removing trailing whitespace print(string.rstrip()); # Output: ' abc' # After removing all whitespace print(string.strip()); # Output: 'abc' Add solution -
Python 2021-10-18 22:25:06
how to order a pizza using python
from pizzapy import Customer, StoreLocator, Order customer = Customer("Navnath", "Gaikwad", "[email protected]", "5093620471", "150720, E, 4th, Avenue, f101, Homestead, Apt, Spokane, 390037, Washigton, DC&quo... Add solution