Got this question as a home work. Can someone help me out?
i
=
1
while
True
:
if
i
%
0O7
=
=
0
:
break
print
(i)
i
+
=
1
Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Ravi Ujjwal
Hello,
It’s output is:
1
2
3
4
5
6
Explanation: The code is very simple. It’s just a loop when upon satisfying a particular condition executes the block and if not the breaks the loop and end the program. Probably you are having problem in this
0O7
. When something is written with a zero and O just adjacent to it like 0O then it is said to be representing a integer into octal form. Here,0O7
means7
. You can find octal of an integer usingoct(integer)
.