python-2.7 tag

27 questions


1 answers
92 views
0
Questions about Python random_chunk.

We are making a function that receives 2 lists and cuts randomly after shuffling. I even followed the location when it became random, but I didn't know how to cut it together during the cutting proces...

2 years ago

1 answers
76 views
0
Question for dividing Python list.

Hello, I'm a beginner in programming. I want to divide the elements in the list into random sizes, what should I do? a = [ 1, 2, 3, 4, 5, 6, 7, 8]#At the time of outputa = [[1,2],[3,4,5],[6,7],[8]]a =...

2 years ago

2 answers
101 views
0
Please help me with functions using Python range

How can I use the range function to input raw_input and repeatedly output the input value 100 times.

2 years ago

2 answers
62 views
0
This is a question about Python for Moon.

def ndiv(l,n): return [l[i:i + n] for i in xrange(0, len(l) // n * n, n)] + [[e] for e in l[len(l) // n * n:]] print INSERTION : {}.format(ndiv(insertion, i)) print INSERTION1 : {}.format(ndiv(inserti...

2 years ago

2 answers
85 views
0
What role does the module sys play in Python?

import syssrc = sys.argv[1]dst = sys.argv[2]f = open(src)tab_content = f.read()f.close()space_content = tab_content.replace(\t, *4)f = open(dst, 'w')f.write(space_content)f.close()It's a code that ch...

2 years ago

1 answers
88 views
0
Questions about Python DB

import sqlite3import datetimeDT_Now = datetime.datetime.now()Today = {}{}{}.format(DT_Now.year, DT_Now.month, DT_Now.day)information = sqlite3.connect(info.db)curs = information.cursor()def CreateTabl...

2 years ago

1 answers
111 views
0
I have a question because the Linux Python version has not been changed.

Existing Python version is 3.6 I tried to change it to Python 2.7 because the module I was going to use didn't work.So even though I changed Python like the capture screen, it keeps coming out as 3.6....

2 years ago
« - 3 -

© 2024 OneMinuteCode. All rights reserved.