Courses
Courses
Code Compiler
Code Compiler
Discuss
Pricing
Teams
Log in
Register
Menu
Q&A Discussions
Search
Search
Ask a question
Ask a question
def some_func(): print("Hi!") var = some_func() print(var)
none
1 Vote
2 Answers
1st Aug 2019, 7:27 AM
Dhyey Badheka
import random class Card: def __init__(self, rank, suit): self.rank = rank self.suit = suit def __repr
0 Votes
1 Answer
23rd Nov 2023, 8:15 AM
محمد محمد
Зачем нужна функция def (в python)? (Ответьте на русском)
def
function
python3
russian
2 Votes
2 Answers
1st Jan 2019, 2:59 PM
Аннушка
Can any one confess me about def function in python..?
python
1 Vote
9 Answers
12th Jul 2021, 5:39 AM
Shaik Umar
what is the output of def square(x): return x * x def test(func, x) : print(func(x)) test( square , 42).
functions
python
-1 Vote
2 Answers
7th Jan 2018, 1:53 AM
Aarnav
how to loop a def function for 3 accounts
def
function-arguments
functions
loop
1 Vote
8 Answers
1st Feb 2022, 5:21 PM
Esther McAngus
Could anyone explain exactly what Def defines?
python
0 Votes
2 Answers
23rd Jul 2019, 1:46 PM
Mateusz Niewinski
What is work of def function
python
0 Votes
2 Answers
9th Feb 2017, 12:08 PM
kunal rao
python def calc _default_ add(x, y, op )
error
function-arguments
python3
1 Vote
3 Answers
2nd Jul 2019, 10:09 AM
Sundas Alduraihem
What is def function nd wtt its use
def
2 Votes
3 Answers
31st Aug 2020, 3:57 PM
#challenger mg
Van someone explain def in Python? Thanks!
python
python3
2 Votes
2 Answers
12th Nov 2017, 3:52 AM
Nitay Eshed
Why should we use lambda functions instead of normal def functions?
def
lambdas
python
14 Votes
5 Answers
16th May 2020, 2:27 AM
Puthur Harthik
What is the use of def in python?
python3
-1 Vote
5 Answers
19th Nov 2018, 2:45 PM
Marwa Ashfaq
Teach me details in def (function) !
functions
python
1 Vote
1 Answer
16th Nov 2022, 3:39 AM
Mozahidul Islam
def my_func(): print("spam") print("spam") my_func() and print("spam) print("spam")
codeplayground
python3
4 Votes
1 Answer
2nd Feb 2019, 6:13 PM
Hari Krishna Sahu
What is the use of def in python?
python
python3
0 Votes
3 Answers
4th Jun 2020, 1:20 PM
Thirunalankumar
how can i def a func.that gives factorial
py
0 Votes
3 Answers
5th Nov 2019, 8:56 AM
Ravi Pratap
What arguments can a tkinter Def take?
functions
help
python
tkinter
1 Vote
1 Answer
28th Nov 2019, 7:10 AM
Noah Sjursen
What is incorrect?
def
0 Votes
9 Answers
11th Oct 2021, 6:31 PM
Dito Shonia
def ModeratedMarks(marks, passMarks): if marks == passMarks-1 or marks == passMarks-2: marks = passMarks return marks def main
python
0 Votes
2 Answers
21st Feb 2022, 6:43 AM
Anushka Dwivedi
what is the use of def in python
boolean-logic
else-statements
functions
hashmap
java
json
node.js
python
selectors
1 Vote
3 Answers
16th Aug 2016, 11:18 AM
Blackhat
def sum(x,y,z): print ("sum of 3 nos:",x+y+z) sum (5,10,15,20,25)
python3
1 Vote
4 Answers
16th Sep 2019, 5:26 PM
Monish
Difference of "def func(x) and def func ()"
definingfunctions
python3
1 Vote
2 Answers
16th May 2019, 7:02 AM
bimyou
What's that def ? Can't figure it out
basics
python
0 Votes
2 Answers
29th Oct 2018, 6:25 PM
partha
как вывести данные из def и записать в файл
file
python3
1 Vote
4 Answers
29th Nov 2019, 1:13 PM
SloN
in the CLASS definition here, why isn't def __init__ ... there????
python
1 Vote
8 Answers
18th Aug 2016, 1:02 PM
Krishna Limani
def extend(num, list=[]): list.append(num) return list x=extend(1) y=extend(2) print (x,y)
python3
0 Votes
5 Answers
11th Apr 2023, 11:21 AM
Somvir Dhaka
def add_numbers(x, y): total = x + y return total print("This won't be printed") def gsc(): z=(add_numbers(4, 5)
function
python3
1 Vote
2 Answers
4th Feb 2018, 3:44 PM
Gaurav Singh
def add(x, y): return x + y def do_twice(func, x, y): return func(func(x, y), func(x, y)) a = 5 b = 10 print(do_twice(add, a, b))
functions
python
return
1 Vote
6 Answers
29th Jul 2016, 10:31 AM
Rupam Das
what are def and how to use it?
class
def
python
1 Vote
2 Answers
3rd Dec 2016, 6:00 PM
Sanju
What is wronh in this code: def my_func(x); assert x>0, "error" print(x) my_func(-1)
assertions
5 Votes
3 Answers
16th Jan 2019, 2:06 PM
Anonymous....
res=1;n=4; def fact(n,res): if n==1: return res; return fact(n-1,n*res)
python3
recursion
tail_recursion
0 Votes
2 Answers
9th Jun 2020, 12:14 PM
Levi
help me what is def in python fully plz??
def
fully
help
in
is
me
plz??
python
someone
what
1 Vote
2 Answers
27th Aug 2019, 5:50 PM
Vignesh Vicky Sfc
def change(Is): Is[1] = 8 Ist = [5,6] change(Ist) print(sum(Ist))
functions
python3
0 Votes
5 Answers
28th Aug 2020, 3:12 PM
Abhishek Kumar
what is going on why is it not squaring def square(x): return x*x def test(square, x): print(x) test (square, 12)
functions
python
1 Vote
3 Answers
23rd Oct 2016, 2:37 AM
toygrill11
Can anyone explain in simple words what def main is?
operators
python
0 Votes
8 Answers
18th Sep 2016, 7:39 PM
Zehwan Rehmani
I am stuck on def functions. Can someone help please?
explain
functions
help
0 Votes
5 Answers
12th Dec 2019, 11:15 PM
James Downing
def func(a,L=[]): L.append(a) return L print(func (3),func (1))
python3
0 Votes
1 Answer
9th Apr 2020, 11:49 AM
kedar padia
class Myclass : def __init__(self,val): self .__n=val obj=Myclass(0) obj.__n=1 print (obj._Myclass__n )
python3
1 Vote
6 Answers
13th Apr 2023, 4:23 AM
Somvir Dhaka
def my_func(x): assert x > 0 , "Error!" print(x)
assertions
0 Votes
2 Answers
21st Aug 2019, 5:01 PM
Rupal Raut
s = input() def hashtagGen(text): s1 = s.replace(" " , "") return "#"+s1 print(hashtagGen(s))
python
1 Vote
8 Answers
22nd Jun 2022, 2:12 PM
Raj Jaiswal185
Why do Def programs use return instead of print?
data-types
python
0 Votes
4 Answers
28th Nov 2016, 2:40 AM
The Nerd Rants
Def sum(a,b): If a==0 or b==0: Return 0: Return 1+sum(a-1,b-1): Print (sum(4,2))
1
answer
explain
is
0 Votes
10 Answers
9th May 2020, 5:15 PM
Colonel Cop
what is the output of def func(x): res = 0 for i in range(x): res += i return res print(func(4))?
python
-11 Votes
17 Answers
7th Jun 2018, 2:21 PM
Saurav nalla
Kind of a silly question for a def function Python
def
function
python
0 Votes
6 Answers
13th Oct 2017, 7:05 PM
Aric Dunn
import calendar def printcalendar(2020); print(calendar.calendar(year)) year = int (input('2020')) printcalendar(2020)
;
0 Votes
2 Answers
8th Aug 2020, 6:48 AM
Jaywardhan
def add(x, y): return x + y def do_twice(func, x, y): return func(func(x, y), func(x, y)) a = 5 b = 10 print(do_
funcionea
1 Vote
2 Answers
23rd Apr 2019, 6:42 PM
Wander Anime
Your all body is working by def in py
biology
cpython
def
py
python
python3
undefined
1 Vote
2 Answers
19th Oct 2017, 1:15 PM
Shabnam
I am not able to update stock
def
0 Votes
6 Answers
10th Jan 2023, 6:28 PM
Gajanan Awate
Guys please I don't seem to fully understand how def functions work in python
python
1 Vote
18 Answers
28th Apr 2018, 7:30 PM
CodeX
Ask a question
Ask a question
Ask a question
Ask a question
< Previous
1
2
3
4
...
8
Next >
Hot today
New code
1 Votes
Does anyone have the solution for this challenge?
1 Votes
How would you solve the part of the C# Intermediate code project that requires operator overloading?
0 Votes
Why does coding take so long to learn
0 Votes
Solved Ai generated practice the last question
0 Votes
Hello Everyone
0 Votes
Solved# Survey data format in coding for data
0 Votes
How to add unordered lists in HTML.
0 Votes
What is the use of .kt classes in the React Native project
0 Votes
Solved #Relay race coding for unit 9 you are creating code for a relay race
0 Votes