Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 months ago. Improve this question Can anyone please help explain what the hell is going on with this
Tag: range
Solved: A simple calculator to accept two numbers and print the addition, subtraction, multiplication, and division of the two numbers
Update: Re did my code. Now **I am unable to find the answer to this issue no 1). ** Newbie here. I spent the whole night trying to figure this out but I feel stuck if anyone can kindly guide me. Below is the question and Code I did for python. Thanks in advance. Limit the input range from -70
I don’t get a print result of function when using range
Why can’t I see the result of the function when I use range()? I want to create a range of numbers where each the number will be evaluate in “colla” function. But range doesn’t work with “colla” Answer Your colla() function requires input numbers of 2 and above. Try this: Please be aware that calling colla(0) will result in an
Python: generate 5 random int (every has own range) with fixed sum
import random #lets take kg(for Total) for better understanding Total = random.randint(40, 110) #For example Total=100 kg and this is 100% Total = (a+b+c+d+e) Each value in Total has own range …
How to check check if a string contains a specific character(s) using range() functions and bools in Python?
I’m trying to check in Python GUI if the user’s email is valid after every key release. So I set global bool variables, which are at and dotcom for email validity, but every time I input a valid email …
Why set automatically unpacks range, but list doesn`t? How this can be used?
I create list and set with range. Set unpacks range, list doesn`t >>> my_list = [range(5)] >>> my_set = set(range(5)) >>> my_list [range(0, 5)] >>> my_set {0, 1, 2, …
Printing rows and columns from xml file in python using range function with len()
I have over 1000 rows imported via an xml file in python and I want to print every second row, starting at the first, to the 20th row from three selected tabs/columns but I can’t figure out how to put …
Python dynamic for loop range size
I’m trying to add Link argument to ini file by using python. Example of ini file: I need to do like this: My for loop: My code works, but it does not add Link for last tags. I’ve found why. If I add in range(len(m)+100): Then code adds all Links. Looks like len(m) is old […]
I get a IndexError: list index out of range Error
I´m having some troubles on my code, that implements a function that verifies the lenght of a string and return that string with or without spaces. If String b >= 15 return b If strinf < 15 return “number os spaces until len(b)2 + string b But I get a IndexError: list index out of […]
Convert range(r) to list of strings of length 2 in python
I just want to change a list (that I make using range(r)) to a list of strings, but if the length of the string is 1, tack a 0 on the front. I know how to turn the list into strings using but I want to be able to also change the length of those strings. Input: Output: And if