slice tag

9 questions


1 answers
89 views
0
Python slice notationPlease tell me

I heard that it's very comfortable to use notation, but it's hard to learn.I'm not sure yet, but can you give me an example?

2 years ago

2 answers
164 views
0
Extract am is z from the string my name is z from python3

I want to extract am is z from the string my name is z from python3[4: ] Not like thisExtract from a, and if z comes out, it's over. [a: z] For example, if it's adkzed, I want to print only adkz Pleas...

2 years ago

1 answers
134 views
0
Questions related to python list.sort().

Group3 = list()Group3.append('A')Group3.append('Da')Group3.append('la')Group3.append('I')Group3.append('c')Group3.append('a')Group3.append('b')Group3.append('羅')Group3.append('家')Group3.append('多')Gro...


1 answers
66 views
0
I have a question about slicing the Python list.

[start:end:step] when slicing the list.a=[1,2,3,4,5]a[:] #[1,2,3,4,5]a[0:5] #[1,2,3,4,5]with the same return valuea[::-1] #[5,4,3,2,1]a[0:5:-1] #[]For a[0:5:-1], the return value is changed by the emp...

2 years ago

2 answers
72 views
0
Cut Python String

You are a Python user.For example, if you have the string a=apple,banana,cow,print_1=appleprint_2=bananaprint_3=cowHow do you create a code that stores it like this?(It's a beginner. I look forward to...

2 years ago

2 answers
128 views
0
I want to include the reference character when sliding the Python string.

If you just slice based on certain characters, those characters don't appear, but only the words are cut off and stored in the list. For exampleHello, world. If you slice it according to ,[Hello, worl...

2 years ago

2 answers
122 views
0
Is there a way to extract only numbers before and after certain characters in Python?

number = '9-11'number1 = '10-30'In Python, how do I print only the values in front of it, and the values in the back?However, since the units of numbers are different like 9 and 10, it is not extracte...

2 years ago

1 answers
104 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...

2 years ago

2 answers
129 views
0
I'm asking if I can loop around the coding beginner list slice.

I'd like to cut and print the bottom list combination of 5 pieces, so can you make the list slice range with a loop and make it automatically??num = int(input())moc = num//4namu = num%4like = 0hell = ...

2 years ago

© 2024 OneMinuteCode. All rights reserved.