integer

"Typeerror int is not collable" from http requests.post()

"Typeerror int is not collable" from http requests.post() Question: I know this question has come up a lot, but I couldn’t find any suitable solution for my problem. from the library requests I try to use something like this: response = requests.post(url, headers, data, proxies) if response.status_code >= 300: logging.ERROR(f"MY ERROR MESSAGE") elif response.status_code < …

Total answers: 1

Is there a Python command to convert a string to an integer?

Is there a Python command to convert a string to an integer? Question: I am a newbie, please forgive my ignorance. I tried researching and reading other articles and questions, but nothing seems to give a proper answer. If the answer is simply no, please just tell me. Basically, I’m working on a project for …

Total answers: 3

How to accept the integer and float values in same input variable in python?

How to accept the integer and float values in same input variable in python? Question: How to Accept the integer and float values in the same input variable in python def interest_rate(): while True: interest_rate = input("Enter the annual interest rates: ") if interest_rate.isdigit() == True: interest_rate = int(interest_rate) if interest_rate >= 0: break else: …

Total answers: 1

Convert String with "." to int in python

Convert String with "." to int in python Question: I want to convert a string with a point to a int to us it in time import time x = "0.5" time.sleep(int(x)) i tried it with this simple code but i get this error ValueError: invalid literal for int() with base 10: ‘0.5’ is there …

Total answers: 2

How can I convert an object dtype to integer by removing letter characters?

How can I convert an object dtype to integer by removing letter characters? Question: My question is related to a conversion of a dtype object to integer. Specifically, I want to remove the characters of the dtype and convert it to integer so I can handle it as an integer. I have the following dataframe: …

Total answers: 2

Integer equivalence of binary number that is represented as an integer in Python

Integer equivalence of binary number that is represented as an integer in Python Question: I have an input a=int(1010). I want to find integer equivalence of binary 1010. If I use bin(a) then output will be 1111110010, but I want to get 10. Asked By: Lee || Source Answers: You need to tell python, that …

Total answers: 1