Error saying TypeError range integer end argument expected

0 votes

I am trying to execute this code in python but I end up with an error:

for X0 in range (-0.02, 0.02, 0.01):
     for Y0 in range (-0.06, 0.09, 0.01)

Error:

TypeError: range() integer end argument expected, got float.
May 27, 2019 in Python by Ishwar
510 views

1 answer to this question.

0 votes

Try this:

[x * 0.01 for x in xrange(10)]

Output:

[0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09]
answered May 27, 2019 by Keshav

Related Questions In Python

0 votes
1 answer

Python error "TypeError: range() integer end argument expected, got numpy.float64."

Hi @Kashish, try something like this: for i ...READ MORE

answered May 27, 2019 in Python by Harish
1,294 views
0 votes
1 answer
0 votes
1 answer

Error:Expected view to be called with a URL keyword argument named “pk”

Hello @kartik, View functions are called with the ...READ MORE

answered Jul 1, 2020 in Python by Niroj
• 82,720 points
1,679 views
0 votes
1 answer

TypeError: Expected Ptr<cv::UMat> for argument '%s' ''

src is the first argument to cv2.cvtColor. The error you ...READ MORE

answered Oct 15, 2020 in Python by anonymous
• 65,870 points
2,485 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,077 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,580 views
0 votes
1 answer

Error saying "TypeError: descriptor object needs an argument"

The error is pretty straight forward, toy ...READ MORE

answered May 28, 2019 in Python by Alisha
5,985 views
0 votes
1 answer

text = _whitespace_only_re.sub('', text) TypeError: expected string or bytes-like object

This seems like an issue with textwrap ...READ MORE

answered Feb 13, 2019 in Python by Omkar
• 69,130 points
7,607 views