function tag

78 questions


1 answers
126 views
0
Question about the range of Python variables

a=0def vartest(a): a=1 return aprint(vartest(a))Why is it said that a is not defined when a=0 is cleared? Since a in the function and a outside of the function are different variables, we defined a=1 ...

2 years ago

1 answers
56 views
0
It's a C language string question

The code below is a function that functions to search for a string in a string. I have a question because I don't understand something while analyzing the code.The first of the two codes below works f...

2 years ago

1 answers
59 views
0
Please interpret the JavaScript

function getNumber(str) { if (typeof str == 'string') { if (isNaN(str)) { return -1; } } else { return parseFloat(str); } } } else if (typeof str == 'boolean') { if (str) { return 1; } } else ...

2 years ago

1 answers
135 views
0
JavaScript word alphabet counting function

// a function that counts how many times a particular letter (ch) is in a given word function countCharacter(word, ch) { var count = 0; var res = word.toUpperCase(); var count = res.indexOf(ch); if(co...


1 answers
74 views
0
C언어 팩토리얼 재귀함수 구현 시 return 1의 의미가 뭔가요?

#define _CRT_SECURE_NO_WARNIGS#include<stdio.h>#include<stdlib.h>int factorial(int n);int main() { int n; scanf(%d, &n); printf(%d\n, factorial(n)); return 0;}int factorial(int n) { if...


1 answers
46 views
0
Repeat list

import randomQ = int(input('drawing lots!') Please enter a quota.')numbers = list(range(1, Q + 1))R1 = random.choice(numbers)print('{} and''.format.(R1))numbers.remove(R1)R2 = random.choice(numbers)pr...


1 answers
76 views
0
How do I make Python function errors?

I am a freshman in college who entered Python. I tried to express the dead rule operation as a function, but the first elif keeps showing an error window called invalid syntax with a red line. I don't...

2 years ago

1 answers
134 views
0
Can't I declare a function in main()?

There was no big problem when the function had 1 variable.However, there was a problem because there were many variables and many declarations.This program applies avg (where to store the mean) and st...

2 years ago

1 answers
81 views
0
Python Baseball Game

import randomcum=random.sample(range(1,10),4)print(cum)def check_list(listname,input_num): listname=[] while len(listname)<=input_num-1: z=0 num=int (Enter a number) listname.append(num) for k ...

2 years ago

1 answers
101 views
0
I'm asking you a question

Hello, I'm asking you a question because I don't understand while studying data analysis with PandaSas.def make_generation(age): if age == -1: return 'Not entered' elif age // 10 >= 4: Late 30s e...

« - 3 - »

© 2024 OneMinuteCode. All rights reserved.