All Questions

19771 questions


1 answers
386 views
0
What does .readlines()[:5] mean when File I/O and what does sourcefile/targetfile mean

First, the code is as followsSourceFile = open(example_dir/lipsum/lipsum.txt, r)TargetFile = open(copied.txt, w)for line in SourceFile.readlines()[:5]: TargetFile.write(line)TargetFile.close()SourceF...

1 years ago

1 answers
362 views
0
I don't understand the Python global variable, so could you give me an answer?

x = 0def A(): x = 10 # Local variable of A x def B(): global x # Use the global variable outside of the current function Allocate 20 to the regional variable x of x = 20 # A B() print(x) # Local var...

1 years ago

1 answers
306 views
0
Python *args, **kwargs questions

def custum_print(value, *args, **kwargs): print(value, *args, **kwargs)custum_print(1, 2, 3, sep=':', end=' ')`In the above code, it is said that it is correct not to attach the whole * to *args and *...

1 years ago

1 answers
437 views
0
Python Code Question (File I/O problem, count = [0] * 10 I don't know what it means.)

The problem is a random 30 count between 1 and 10.Create an in file using a random module. Then read this file and print out the number of occurrences of integers from 1 to 10 in the count.out file. /...

1 years ago

1 answers
446 views
0
Three Python questions

I'm solving Python questions, but these three questions are hard 1) Let's write a program that reads integers and obtains sums and averages. However, the input of integers shall be made within the ran...

1 years ago

1 answers
300 views
0
How to access cookies in the Next.js API

Hello, I'm using Nexst.jsI'm a junior front-end developer.To access the DB APII also configured API for nextFailed to get the token value stored in the cookieI'd appreciate it if you could tell me how...

1 years ago

1 answers
419 views
0
I have a quick question

#include <DHT11.h>#define DHTPIN A0#define DHTTYPE DHT11DHT11 dht(DHTPIN, DHTTYPE);void setup() { Serial.begin (9600); pinMode(8, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(A1, INP...

1 years ago

0 answers
425 views
0
Node.js. Here's your questioncrying

I was going to do node.js with the visual style codeI can't get it out...I also set up a terminal, but other people set up a terminal and enter to get the output right away..cryingWhat's the problem

1 years ago

1 answers
358 views
0
c++ question

using namespace std;class Point {private: int x; int y; static int numCreatedObjects;public: Point() : x(0), y(0) { numCreatedObjects++; } // constructor receiving int_x and int_y as inputs Point(int...

c++
1 years ago

2 answers
429 views
0
Am I the only one who can't run and submit the coding test code now?

If you can, please leave a reply.

1 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.