split tag

25 questions


2 answers
83 views
0
How do I extract only the required columns from a txt or csv file and save them as a txt file?

with open('file name.csv') as file: csv_data = [] for line in file.readlines(): csv_data.append(line.split(','))I know how to divide rows and columns.Invoke only the columns you needI don't know how ...

1 years ago

1 answers
83 views
0
To read the entire file as a string rather than a list?

My file is LLKKKKKKKKMMMMMMMMNNNNNNNNNNNNNGGGGGGGGGHHHHHHHHHHHHHHHHHHHHEEEEEEEEIt looks like it. If you use the source code below and read it,['LLKKKKKKKKMMMMMMMMNNNNNNNNNNNNN\n', 'GGGGGGGGGHHHHHHHHHH...

1 years ago

1 answers
52 views
0
You want to spell a string one by one and save it as a list

s = hello python!s.split()If you do s.split() in the above code, it is saved as [hello, python!] based on the space, right? Instead, I want to save the spelling in ['h', 'e', 'l', ..., '!'] like this,...

1 years ago

3 answers
106 views
0
Reverse by Python string word

Hello, it's nothing but a = input()print (a[::-1])For example, how are you is uoyera woh.I'd like to make each spelling upside down, not backwards, but backwards based on spacing.If it's how are you, ...

1 years ago

1 answers
122 views
0
Python join, reduce split space

I'm going to download the process list from cmd to txt and reduce the gap with Python.(tasklist | findstr > a.txt to create a text file.)A list of processes is saved in the following format:sms.exe...

1 years ago

2 answers
73 views
0
Python case lettering and spacing questions.

I'm asking you a question because I thought of it while I was learning Python by myself.When you enter an English name without spacing as followsRyuHyunJin as follows[Ryu, Hyun, Jin] is about to be ou...

1 years ago

1 answers
114 views
0
Output using split

When outputting a string with the split function as 1,2,3,4,5 Day = 1This = 23 = 3 G = 4 Oh = 5What should I do if I want to print it out like this

1 years ago

1 answers
100 views
0
To change a character to a time form in Python

Hello.Python used an external api to call up the time3m 32s and 1h 23m 6s are written like this.How do I change it to separate it into a colon by two digits like 00:03:32 and 01:23:06?It's kind of vag...

1 years ago

1 answers
80 views
0
Separating list elements by separator

col_list = ['FLIGHT_DATE\tFLIGHT\tDEP_AIRPORT\tARR_AIRPORT\tSALABLE_SEAT\tRES_PAX_CNT\tADULT_PAX_CNT\tCHILD_PAX_CNT\tBOARD_PAX_CNT']I'd like to split this up by \t.What I did was[i.split('\t') for i i...

1 years ago

1 answers
78 views
0
Python split related error

def cal(a,b): print(a,'+',b,'=',a+b) print(a,'-',b,'=',a-b) print(a,'*',b,'=',a*b) print(a,'/',b,'=',a/b)n=int (input ('two integer inputs:')).spilt()cal(n)If you create a function like this and enter...

1 years ago
« - 2 - »

© 2024 OneMinuteCode. All rights reserved.