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
603 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,590 views
0 votes
1 answer

Python error "TypeError: 'encoding' is an invalid keyword argument for this function"

Trying using the io module for this ...READ MORE

answered Aug 2, 2019 in Python by Vaishali

edited Oct 7, 2021 by Sarfaraz 9,088 views
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 2, 2020 in Python by Niroj
• 82,880 points
3,025 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,970 points
3,796 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,537 views
0 votes
1 answer
+5 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,918 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
7,577 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,170 points
7,839 views