Aug-27-2018, 09:49 PM
Hello all,
I've been using PowerShell for years but am brand new to Python. I'm trying to figure out if I can use an If statement without a specifically defined variable. For instance, the following throws an error:
Apologies for any errors in this post's format, my first one on this site.
I've been using PowerShell for years but am brand new to Python. I'm trying to figure out if I can use an If statement without a specifically defined variable. For instance, the following throws an error:
import re If re.match("he","hellostring")): print("match!")In PowerShell, I could use the $() special operator to cast a statement as a variable, and I'm wondering what I need to do to make the above If statement work, or if i need to assign the re.match() statement to a variable and then put the variable in the If statement?
Apologies for any errors in this post's format, my first one on this site.
