python3.7 tag

12 questions


1 answers
106 views
0
What does it mean if an argument has a colon when defining a function?

I'm playing with checkiO and the function presented is It also says def data (password: str): It also says def data (password: str) -> str:I'm just a beginner at Python, so I only know that you spe...


1 answers
124 views
0
How to put values in cells in multiple sheets in Python Excel?

import openpyxlwb = openpyxl.Workbook('part1.xlsx')for i in range(0,10): sheets = wb.create_sheet('sheet%d'%(i),i)s = []for i in range(0,10): s.append('sheet%d'%(i))list = [X, Alpha, Beta, Gamma, B/A,...


1 answers
103 views
0
I don't know why I get an error.

print=Hello! This is pie coffee that stir-fry fragrant coffee beans. Please choose a language!) language=int (input('1. Korean 2.english 3.')語本')def coffee(c): if language == 1: if c==1: a=1500 el...

2 years ago

1 answers
152 views
0
I have a question about creating an Excel file!!!

import openpyxl# You must create an empty excel file named sample.xlsx in the same folder as the py file.excel_document = openpyxl.load_workbook('same.xlsx')sheet1 = excel_document.get_sheet_by_name('...

2 years ago

1 answers
149 views
0
A game made with pygames... There's a problem with a piece of code... Help me.

import pygame.localsimport gameCode.player_antimport gameCode.soilpygame.init()display = pygame.display.set_mode((1280, 720))displaySurface = pygame.Surface(display.get_size())clock = pygame.time.Cloc...

2 years ago

1 answers
145 views
0
What's wrong here?

import pygame.localsimport gameCode.player_antimport gameCode.soilpygame.init()display = pygame.display.set_mode((1280, 720))displaySurface = pygame.Surface(display.get_size())clock = pygame.time.Cloc...

2 years ago

1 answers
97 views
0
Questions about Python operation order

9%3==0 & 9%5==0Expected result value: False, Actual result value: True I know that this result comes out because of the difference in the order of calculationI wonder how the expression that comes...

2 years ago

1 answers
138 views
0
I wonder how to use the sheet in Python Excel

import openpyxllist = [X, Alpha, Beta, Gamma, B/A, C/A, C/B]initSet = ['0.1', '0.2', '0.3', '0.4','0.5','0.6','0.7','0.8','0.9']A = [0.3, 0.5, 0.7, 0.4, 0.2, 0.6, 0.4, 0.8, 0.2]B = [0.1, 0.3, 0.5, 0.7...

2 years ago

1 answers
132 views
0
Please tell me how to combine them according to the Python Pandas data frame conditions and calculate specific values.

with open(test.json, 'r', encoding=UTF8) as file: lines = file.readlines() json_data = [json.loads(ln.replace(\n, ))['data'] for ln in lines] df = pd.DataFrame(json_data)The structure of the df above ...


1 answers
101 views
0
This is a question about the Korean encoding problem in Python django json response

def vanalysis(request): device = Device.objects.all() locations_list = list() for d in device: try: location = d.dev_name.split(';')[2].split(' ')[0] except Exception as e: location = 'Data error'...

- 1 - »

© 2024 OneMinuteCode. All rights reserved.