Issue
How to add two lines of code to run in a if statement in python 3 but still in one line?
What I am trying to do is that i have two lines of code
print('Yes')
print('This is a dumb question')
And i have to run them in a if statement, like
if cat == "meow":
print('Yes')
print('This is a dumb question')
So i can do it in one line like
if cat == "meow":print('Yes')
Now i have to put the second print statement to the if statement while still maintaining it in 1 line, Can i do this?
Solution
if cat == "meow":print('Yes'); print('This is a dumb question')
Answered By - datamansahil Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.