T
T
Tash1moto2015-08-11 20:31:06
Python
Tash1moto, 2015-08-11 20:31:06

How to pass the result of a function to another function, python?

How to pass the result of a function to another function, python ? preferably without any yelds and decorators
. The paths of data travel from one method to another, third, etc. are confused in my head
. I practice, set different tasks and try to complete ..
here is the code - https://jsbin.com/nitocu/edit?js

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tash1moto, 2015-08-11
@Tash1moto

#coding:utf-8

class MyClass:
    def __init__(self,x,y,z):
        self.x=x
        self.y=y
        self.z=z

    def calc_method(self,x,y,z):

        return (x + y/z)

    def printing_calc_result(calc_method):

        print calc_method # - хочу показать результат подсчета а не показать то что это функция)



##########################################

root = MyClass(150,60,40)
root.printing_calc_result()

I'll leave it here

R
Ruslan Luxurious, 2015-08-14
@oshikuru

https://ru.wikipedia.org/wiki/Higher_order_function - works in python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question