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 in Python by Ishwar
84 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 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 in Python by Harish
202 views
0 votes
1 answer
0 votes
0 answers

what is the purpose of the argument 'end' in the print function?

is it necessary to use this argument ...READ MORE

May 9 in Python by Waseem
• 4,480 points
20 views
0 votes
1 answer

What to do when I get and error saying python not recognized as internal or external command?

You need to set up the path ...READ MORE

answered May 28 in Python by Fata
• 1,040 points
53 views
+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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 405 views
+4 votes
6 answers
0 votes
1 answer

Error saying "TypeError: descriptor object needs an argument"

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

answered May 28 in Python by Alisha
1,487 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 in Python by Omkar
• 68,180 points
2,866 views