Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Yes, you can just use lambda expressions. They are made for this.

iterator(lambda x: x/4+12, 100, 5) 

Words from the docs:

Lambdas are usually used to create small, anonymous functions. Actually, they are just a syntatic sugar to define functions. The lambda expression above is exactly the same as your function, only without a name.

If you wish to learn more, Here is some good read:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html
Why use lambda functions?Why use lambda functions?

Yes, you can just use lambda expressions. They are made for this.

iterator(lambda x: x/4+12, 100, 5) 

Words from the docs:

Lambdas are usually used to create small, anonymous functions. Actually, they are just a syntatic sugar to define functions. The lambda expression above is exactly the same as your function, only without a name.

If you wish to learn more, Here is some good read:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html
Why use lambda functions?

Yes, you can just use lambda expressions. They are made for this.

iterator(lambda x: x/4+12, 100, 5) 

Words from the docs:

Lambdas are usually used to create small, anonymous functions. Actually, they are just a syntatic sugar to define functions. The lambda expression above is exactly the same as your function, only without a name.

If you wish to learn more, Here is some good read:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html
Why use lambda functions?

added 128 characters in body
Source Link
aIKid
  • 28.6k
  • 5
  • 42
  • 65

Yes, you can just use lambda functionsexpressions. They are made for this.

iterator(lambda x: x/4+12, 100, 5) 

They are also called as 'anonymous functions', which means you don't have to assign them a name. Perfect for this case!Words from the docs:

Lambdas are usually used to create small, anonymous functions. Actually, they are just a syntatic sugar to define functions. The lambda expression above is exactly the same as your function, only without a name.

If you wish to learn more, Here is asome good tutorial on itread:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html
Why use lambda functions?

Yes, just use lambda functions.

iterator(lambda x: x/4+12, 100, 5) 

They are also called as 'anonymous functions', which means you don't have to assign them a name. Perfect for this case!

If you wish to learn more, Here is a good tutorial on it:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html

Yes, you can just use lambda expressions. They are made for this.

iterator(lambda x: x/4+12, 100, 5) 

Words from the docs:

Lambdas are usually used to create small, anonymous functions. Actually, they are just a syntatic sugar to define functions. The lambda expression above is exactly the same as your function, only without a name.

If you wish to learn more, Here is some good read:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html
Why use lambda functions?

added 128 characters in body
Source Link
aIKid
  • 28.6k
  • 5
  • 42
  • 65

Yes, just use lambda functions.

iterator(lambda x: x/4+12, 100, 5) 

They are also called as 'anonymous functions', which means you don't have to assign them a name. Perfect for this case!

If you wish to learn more, Here is a good tutorial on it:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html

Yes, use lambda functions.

iterator(lambda x: x/4+12, 100, 5) 

Yes, just use lambda functions.

iterator(lambda x: x/4+12, 100, 5) 

They are also called as 'anonymous functions', which means you don't have to assign them a name. Perfect for this case!

If you wish to learn more, Here is a good tutorial on it:

http://www.diveintopython.net/power_of_introspection/lambda_functions.html

Source Link
aIKid
  • 28.6k
  • 5
  • 42
  • 65
Loading