Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: f1(), f2() lambda functions addition
Post: RE: f1(), f2() lambda functions addition

Ok i got this. All I needed to do was to define new function , f3, like this: f3 = lambda x: f1(x) - f2(x) and then calling NR() with f3 Thanks for the help any ways
Danielk121 Homework 5 5,822 Dec-02-2017, 09:27 AM
    Thread: f1(), f2() lambda functions addition
Post: RE: f1(), f2() lambda functions addition

Yes because when you write f1() like you did it expects an argument, integer in this case (my h.w). Then it calculate also but I dont wish for that
Danielk121 Homework 5 5,822 Dec-01-2017, 10:00 PM
    Thread: f1(), f2() lambda functions addition
Post: RE: f1(), f2() lambda functions addition

import random def diff_param(f,h=0.001): return (lambda x: (f(x+h)-f(x))/h) def NR(func, deriv, epsilon=10**(-8), n=100, x0=None): if x0 is None: x0 = random.uniform(-100.,100.) ...
Danielk121 Homework 5 5,822 Dec-01-2017, 09:40 PM
    Thread: f1(), f2() lambda functions addition
Post: f1(), f2() lambda functions addition

I got this home assignment where i need to use the Newton-Raphson method to find a root of a given function. this time I needed to search for a common meeting point of two given functions - f1() and...
Danielk121 Homework 5 5,822 Dec-01-2017, 09:23 PM
    Thread: if statement in for loop
Post: RE: if statement in for loop

(Nov-12-2017, 10:03 AM)metulburr Wrote: You can only put them like that because of list comprehensions. Dont use range(len()) in a for loop in python https://python-forum.io/Thread-Basic-Nev...n-s...
Danielk121 Homework 3 3,748 Nov-12-2017, 07:09 PM
    Thread: if statement in for loop
Post: if statement in for loop

I want to add an if statement in to a for loop so that if the statement is false, then the loop stops. something like this: for i in range(0, len(list_of_nums) if list_of_nums[-1] != list_of_nums[i...
Danielk121 Homework 3 3,748 Nov-12-2017, 09:50 AM
    Thread: Incrementing binary number
Post: RE: Incrementing binary number

(Nov-10-2017, 11:40 AM)DeaD_EyE Wrote: The method insert of lst_binary returns None. Just memorize, that methods which mutates the object, returns regularly None. Immutable objects return something,...
Danielk121 Homework 2 3,896 Nov-10-2017, 12:04 PM
    Thread: Incrementing binary number
Post: Incrementing binary number

Hello, I got this assignment of incrementing a binary number (which displays as a string) without using base converting. i wrote the code which i think is pretty good, but i got stuck with an error...
Danielk121 Homework 2 3,896 Nov-10-2017, 10:34 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020