Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

So I am writing some code in python 3.1.5 that requires there be more than one condition for something to happen. Example:

def example(arg1, arg2, arg3):

if arg1 == 1:

if arg2 == 2:

if arg3 == 3:

print("Example Text")

The problem is that when I do this it doesn't print anything if arg2 and arg3 are equal to anything but 0. Help?

1 Answer

0 votes
by (106k points)

You can use the below-mentioned code for that:-

def example(arg1, arg2, arg3):

if arg1 == 1 and arg2 == 2 and arg3 == 3:

print("Example Text")

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Sep 20, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...