Python, how to input a complex number
|
04-29-2021, 04:02 PM
(This post was last modified: 04-29-2021 04:13 PM by Stevetuc.)
Post: #2
|
|||
|
|||
RE: Python, how to input a complex number
(04-29-2021 02:36 PM)Dirk.nl Wrote: According to Python documents, you can enter a complex number like this; var=complex(input())Looking online, it seems input cannot directly pass a complex number to complex(). I haven't tried this, but it's suggested to take a string as input then convert to complex number: https://stackoverflow.com/a/57403645 Code:
Edit: hmm ignore my post, other posts at tht url suggest your syntax should work as is. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Python, how to input a complex number - Dirk.nl - 04-29-2021, 02:36 PM
RE: Python, how to input a complex number - Stevetuc - 04-29-2021 04:02 PM
RE: Python, how to input a complex number - Dirk.nl - 04-29-2021, 05:04 PM
RE: Python, how to input a complex number - Didier Lachieze - 04-29-2021, 06:37 PM
RE: Python, how to input a complex number - Stevetuc - 04-30-2021, 08:55 AM
RE: Python, how to input a complex number - Albert Chan - 04-30-2021, 10:36 AM
RE: Python, how to input a complex number - Dirk.nl - 04-29-2021, 07:20 PM
RE: Python, how to input a complex number - Dirk.nl - 04-30-2021, 09:51 AM
RE: Python, how to input a complex number - toml_12953 - 04-30-2021, 10:36 AM
RE: Python, how to input a complex number - Dirk.nl - 04-30-2021, 10:55 AM
RE: Python, how to input a complex number - parisse - 04-30-2021, 11:57 AM
RE: Python, how to input a complex number - Dirk.nl - 04-30-2021, 01:21 PM
|
User(s) browsing this thread: