Cours
Cours
Compilateur de code
Compilateur de code
Discuter
Équipes
Se connecter
S'inscrire
Menu
Discussions Q&R
Chercher
Chercher
Poser une question
Poser une question
def aunt(x, y): return x + 2 def log (x,y): return x*y def do_twice(name, x, y): return name(name(x, y), log(x, y)) x = 5 y= 3 print(do_twice(aunt, x, y)) Solve this problem step by step
python
0 Vote
3 Réponses
31st Jul 2016, 12:06 PM
Rupam Das
class Tweet: def _init_(self,message): self.x=message a = Tweet('nishqnt') print(a.x)
python3
0 Vote
1 Réponse
10th Apr 2020, 2:49 PM
Nishant Pratap Singh
Pls, how can I write this same code, with def function and still get d same result? I've been trying but different result.
5
0 Vote
4 Réponses
28th Apr 2021, 2:11 PM
Adibeh Esther
def power(x, y): if y == 0: return 1 else: return x * power(x, y-1) print(power(2, 3))
memorization
recursion
2 Votes
9 Réponses
11th May 2019, 9:51 AM
Магомед Акуев
How this code works, can anybody help me to understand this code.
def
python
python3
5 Votes
24 Réponses
30th Jun 2021, 5:48 AM
Sagar Yadav
What is wrong with this equation
def
3 Votes
2 Réponses
22nd Jun 2019, 3:36 PM
Oketunbi Olatunji
def sum (a,b): if a == 0 or b == 0: return 0
function-arguments
2 Votes
5 Réponses
19th Oct 2022, 9:23 AM
Eren Kılıçlar
How to write into csv file through def function ?
cpython
development
python
python3
web
0 Vote
2 Réponses
20th May 2020, 2:49 PM
Bharat Mangal
convert it into lambda def myfunc (x) s=s*2+67 g=29×a return g
python
0 Vote
5 Réponses
12th Oct 2016, 9:08 AM
khateeb anwer
def modify_last(txt, n): s=txt[:] d=txt[-1]*n s,d=gather return "".join(gather) modify_last("Hello", 3) #➞ "Hello
python.string
0 Vote
5 Réponses
9th Oct 2020, 12:20 PM
ÄKoderj
Please help why are x and y being added together ? What am I missing
def
python3
1 Vote
11 Réponses
28th Oct 2022, 8:10 AM
Steven kervick
def x(): print (list(range(10,20,2 ))) z=input() if z=="check": x()
functions
python
0 Vote
1 Réponse
11th Aug 2017, 5:54 PM
knock knock
The code doesn't execute properly try to figure out why?
def
-2 Votes
4 Réponses
7th Jan 2018, 8:13 AM
Adlion🤘
Please how can i code some integers e.g [47,1900,1,90,45] to return a sum of two digits
def
1 Vote
5 Réponses
4th Mar 2017, 2:17 PM
Marion Rain
def convert(num): if num == 0: return 0 else: return (num % 2 + 10 * convert(num // 2))
python
recursion
5 Votes
13 Réponses
3rd Sep 2022, 6:01 PM
Mohammad Faiz
how to call a parameter from the def init method in @staticmethod ?
help
python
python3
0 Vote
6 Réponses
14th Aug 2021, 7:06 PM
Alisa Zaiceva
def search (text, found): if word in text: print("word found") else: print("word not found") Guy
python
0 Vote
6 Réponses
3rd Sep 2021, 12:19 PM
Husni
can u correct issue within code
def
0 Vote
3 Réponses
11th Oct 2020, 4:58 PM
#challenger mg
Can we use anything else except def in the pattern
python
regular-expressions
0 Vote
1 Réponse
26th Jul 2018, 3:03 PM
adarsh pandey
plz explain me community members"....thx as usual
def
0 Vote
3 Réponses
21st Sep 2020, 4:16 PM
#challenger mg
I don't understand, why result is 6 def func(x): res=0 for i in range(x): res+= i return res print (func (4))
python
3 Votes
16 Réponses
8th Sep 2016, 12:47 PM
Giorgi
Can somebody explain def functions and related things And a example
def
fun
python
1 Vote
3 Réponses
27th Dec 2016, 1:52 AM
Nate
What is the result of this code? def print_double(x): print(2 * x) print_double(3)
help
0 Vote
3 Réponses
20th Nov 2020, 5:46 PM
Bilal Fuad
Make a program using def function which clearly explains the return
return
0 Vote
2 Réponses
2nd Jun 2020, 7:35 AM
Aditya Salabh
Please pals what is the function of (def) in python programming, please someone should help me out
def
2 Votes
2 Réponses
2nd Apr 2018, 4:43 PM
Victor Nwosunneji
where did I go wrong in this code for it to give me 1instead of 2? class A: def method(self): print (1) class B(A): def method(self): print(2) B().method()
inheritance
python
1 Vote
5 Réponses
1st Aug 2016, 12:03 PM
winston j.c mhango
def mystery(l): l = l + l return() my list = [ 31,24,75] mystery (my list)
python
0 Vote
14 Réponses
5th Feb 2017, 4:08 AM
kavitha.k
Can we convert a def variable to a new variable like suppose def i (tp) :,,, i (tp) = ncb i think it easy to call
def
1 Vote
2 Réponses
27th May 2018, 5:33 PM
Prateik Jindal
python
def
2 Votes
3 Réponses
26th Sep 2017, 12:34 AM
Nikhilesh Boppana
How to draw first official US flag using def and turtle?
python
0 Vote
3 Réponses
8th Jan 2017, 4:56 PM
Seng Thai
I have been spent 3 days on "SECOND LESSON- 2ND LESSON" and still i dont know about its functioning..plz note : only 2nd slide
def
0 Vote
2 Réponses
22nd Sep 2020, 12:43 AM
#challenger mg
def mystery(s): for i in range(len(s),1,-2): s = s[1:]+s[0]; return(s) mystring="siruseri" mystring=mystery(mystring)
python
2 Votes
2 Réponses
18th Feb 2018, 6:18 AM
kamalesh vra
def g(x): (q,d) = (1,0) while q <= x: (q,d) = (q*10,d+1) return(d)
python
1 Vote
3 Réponses
14th Aug 2018, 5:46 AM
kamalesh vra
def factorial(x): if x == 1: return 1 else: return x * factorial(x-1) print(factorial(5))
recursion
0 Vote
4 Réponses
24th May 2020, 5:39 AM
ANONYMOUS
Python. Can someone please explain me for what do we use def ()?
programme
project
python
python3
1 Vote
2 Réponses
30th Apr 2019, 8:10 AM
JohnSia2005
Why can't I use the input function in the def function in python?
def
functions
input
python3
3 Votes
2 Réponses
6th Jan 2018, 11:35 AM
Majd
What is definition declare and call and def plzz explain with one example
clanguage
1 Vote
2 Réponses
18th Aug 2022, 4:27 PM
FAREED 5C0 !
What is the difference between def and class in python3 ?
class
def
func
python
python3
question
urgent
1 Vote
1 Réponse
8th Sep 2017, 3:36 PM
Exclbr
[Python:OutputExplanation] Someone explain me output of this code. def func(a, L=[]): L.append(a) return(L)
function-arguments
lists
python3
1 Vote
2 Réponses
7th Jun 2018, 2:36 PM
Gopal Gautam
kindly explain.When n<=2 ,the answer is 5 ,but when n<=1,answer is 3. While n=n%5 so 9%5= 4. While 4 is bigger than both 1 and 2
def
return
1 Vote
7 Réponses
25th Jun 2022, 11:42 AM
Tafseer Ahmad
Can't understand def func what's he want I can't understand this...... How to solve this.....
..
1 Vote
3 Réponses
2nd Jun 2022, 12:11 PM
Mohammad Zakir
What is the output of this code? def f(x=[]): x+=[3] return sum(x) print(f()+f() + f())
python
1 Vote
2 Réponses
12th Feb 2023, 7:44 AM
Gaurav Ghadge
def multi(): return [lambda x:i*x for i in range(4)] print ([m(2) for m in multi()])
python3
0 Vote
3 Réponses
14th Apr 2023, 3:19 PM
Somvir Dhaka
How to correct def __init__() error in my block chain cryptocurrency code
error
python
0 Vote
1 Réponse
22nd Feb 2019, 7:26 AM
News Quest
Why we need "Def" function?
def
0 Vote
2 Réponses
9th Oct 2017, 5:54 AM
Baktybek
def addition(): first= int(input('what is your first number')) second = int(input('What is your second number?'))
q
1 Vote
3 Réponses
19th Oct 2020, 12:37 PM
Ar Kar Moe
Please explain def __init__(self) in embedded for every test case starts with it.
basics
python
0 Vote
3 Réponses
11th May 2017, 5:27 PM
siva ram
I know that def is function but can somebody show the example how to use the function def?
python
0 Vote
8 Réponses
16th Aug 2020, 1:51 PM
Kir-Py
input_list =[33,15,27,8,35,42,19,48] def selection_sort (input_list): size = len (input_list) for num in range (0,size-
help
plz
1 Vote
2 Réponses
6th Feb 2022, 11:33 AM
Akshaya Isaac
Why does this say invalid sayntax on line two class goblin: def __init__(self,health) self.health=health gragnack=goblin(10,200) print(gragnack)
class
python
2 Votes
6 Réponses
7th Jan 2017, 1:41 AM
Nate
Poser une question
Poser une question
Poser une question
Poser une question
< Précédent
1
...
3
4
5
...
8
Suivant >
Aujourd'hui en vedette
Ejercicio Pytho
0 Votes
What's wrong with this code ? ( Beginner)
2 Votes
What is that z for
0 Votes
Bug on "Java for Beginners Module 3 Quiz"
1 Votes
Suggestions needed
4 Votes
Write a program to find the strings are in isogram or not
0 Votes
Please rate my code from 1 to 10
2 Votes
How to start
0 Votes
Is there any new bug in the projects reply sections?
0 Votes
Recursion doubt
2 Votes