How to use in python for loop not equal marks? example: a!=0

0 votes

How can I in python for loop use not equal marks or how can I convert  while a!=0 to for loop

Sep 26 in Python by Azizjon
• 120 points
118 views

2 answers to this question.

0 votes

Hi, @Azizjon,

Regarding your query, I would suggest you go through this: https://www.edureka.co/community/33869/how-to-use-not-equal-operator-in-python

The given link has the exact solution for your query, I hope it will help you for sure. Let us know if it helps!!

answered Sep 28 by Gitika
• 51,280 points
0 votes

Hello @Azizjon,

You can go through the example below for your query.

$ python3.7
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 10 <> 20
  File "<stdin>", line 1
    10 <> 20
        ^
SyntaxError: invalid syntax
>>> 10 != 20
True
>>> 10 != 10
False
>>> '10' != 10
True
>>> 

answered Oct 12 by Gitika
• 51,280 points

Related Questions In Python

0 votes
2 answers

How to use not equal operator in python

You can use "!=" and "is not" ...READ MORE

answered Mar 17 in Python by rahul
• 360 points
72,586 views
0 votes
1 answer

How to use for loop in Python?

There are multiple ways of using for ...READ MORE

answered Mar 4, 2019 in Python by Priyaj
• 57,700 points
88 views
0 votes
1 answer

How to write "not equal" in python?

The keywords is and is not are ...READ MORE

answered Sep 17, 2018 in Python by SayantiniDeb
• 200 points
774 views
0 votes
1 answer

In python how to test a string for a substring

if "ABCD" in "xxxxABCDyyyy": This can be used ...READ MORE

answered Oct 24, 2018 in Python by Priyaj
• 57,700 points
234 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,570 views
0 votes
0 answers
0 votes
1 answer
+1 vote
8 answers

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

Just for the record: >>> int('55063.000000') Traceback (most recent ...READ MORE

answered Aug 17 in Python by pakainfo
• 200 points
183,627 views