What does & Python mean? What is your name? is an operator?

Asked

Viewed 516 times

4

I was looking over the loop while in Python, and everything was going well, but suddenly I see: "&", that even searching I could not find anything about.

i = 0
while i < 5 :
     print(i)
     i = i + 1

Exit:

0
1
2
3
4

1 answer

8


This does not exist in Pyhton, this is practically a typo, if you put this to compile will give error. This is pure HTML (before display), is how HTML represents characters < not to be confused with the opening of tag. So this code is actually this:

i = 0
while i < 5:
     print(i)
     i = i + 1

This works perfectly. See the original code nay working in the ideone.

So you’re probably using some defective technology that works with code on the web that just got confused and even though you’re showing it, you can only run it because it has the right real code and not this.

Python has a & and he is the same as in other languages, is the operator "and" bitwise, but it has nothing to do with that code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.