def tag

20 questions


2 answers
126 views
0
Python Input Value Integer Determination Function Basic Question

Hello, I'm a beginner who recently started learning Python.I want to create a function that returns True or False by writing def and then returns a different value according to the returned True/False...

1 years ago

1 answers
55 views
0
I want to code to guess numbers using def.

I want to code num_guess using def.Existing num_guess coding is import randomanswer = random.randint(1,100)try_cnt = 5while True: if try_cnt == 0: print(Game over.\nThe Answer is {}.format(answer)) ...

1 years ago

1 answers
117 views
0
If conditional questions: if i == "What time is it?" or "What time is it now?" or "Tell me the current time."

import datetimeimport sysstart_time = datetime.datetime.now()def bitbox (): print (Hitting the drum)i = input (Did you call Siri?[Yes/No])ifi == Yes: print (I'm listening...) input (Enter=>)Ifi == ...

1 years ago

1 answers
108 views
0
Example of defining a function to query an ID value when entering a Python coding ID.

Hello, I have a question.df.[df[IDColumn] == ID]If you enter the corresponding ID here, you can simply see the value accompanied by the ID. In addition to this method, Please define a function using t...

1 years ago

1 answers
110 views
0
I'm working on a class search program, so please give me some advice

class stat: def __init__(self, line): self.genre = line[1] self.member = line[2] self.album = line[3] self.like = int(line[6]) self.stat = [] self.total = 0 def like_sub(self.line): a = stat(se...

1 years ago

2 answers
119 views
0
Function execution

a = float(Enter the required amount:)c = float(Enter the conversion factor: )))def ZEB(): n = print(a * c) if n < 80: print (Grade is A) elif 80 <= n < 140: print (Grade B) elif n >= 14...

1 years ago

2 answers
123 views
0
Converting ISO2 code by Python basic country to continental name

Hello.In order to convert the country-specific ISO2 code to a continental name, try for 5 hours and then post a question because it gets stuck.First of all, I modified the code that I got through Goog...

1 years ago

1 answers
127 views
0
Function pointer question.

I understand that typeef or using can be used to simplify the use of function pointers.typedef void func1(int, int);typedef void (&func2)(int, int);typedef void (*func3)(int, int);By the way, I wa...


1 answers
114 views
0
Convert function result value to over pi

import numpy as npu = np.random.randint(2,size=(1,100))print(u)print(np.size(u,1))def turbo_enc(u): K = np.size(u,1) print(K) enc = np.zeros_like(u) enc = u return encenc1 = turbo_enc(u)print(enc1)def...

1 years ago

2 answers
76 views
0
def function question

Image 1 is the problem and Image 2 is the correct answer.def multiples(n, m): for i in range(1,m+1): print(n*i,end='')r1,r2,r3,r4=multiples(3,4)print(r1,r2,r3,r4)r1,r2,r3,r4,r5=multiples(2,5)print(r1...

def
1 years ago
« - 2 -

© 2024 OneMinuteCode. All rights reserved.