Q:

How to make an if statement have a output

I am currently working on a blackjack game without graphics or pygame I can not seem to make an if statement with input, I took a month off of python and can't really understand the questions already answered.
Here is my code so far:
def pullCard():
    print(f"You pulled a {r} of {s} the value is {v}")
    print(f"The dealer pulled a {dr} of {ds} the value is {dv}")

pullCard()

Answer = input('Do you want to Hit or Stand?')

if Answer == 'Stand' or 'stand':
    dealerOnly()
if Answer == 'Hit' or 'hit':
    pullCard()

I have not defined dealerOnly() every time i say Hit or Stand it just comes out with the error.
Do you want to Hit or Stand?Hit
Do you want to Hit or Stand?
Traceback (most recent call last):
  File "C:\Users\Brody Critchlow\Downloads\Blackjack\Blackjack.py", line 36, in <module>
    dealerOnly()
NameError: name 'dealerOnly' is not defined

Even though i said Hit not Stand

A:

You have to understand that python uses truthy and falsey values, it means, that not only True and False are true and false, also strings and lists and other values, examples:
if "":
  print("wont enter, falsay value")

if("Hit"):
  print("Something, truthy value")

if []:
  print("wont enter, falsay value")

if [1,2,3]:
  print("Something, truthy value")

your main problem, is in this two expressions:
if Answer == 'Stand' or 'stand':
if Answer == 'Hit' or 'hit':

here, you use an or, it means that if anything is truthy, the block inside the if will be executed, and 'stand' and 'hit' are not an empty str, so it will always be executed because they are both True
Also, the other problem is that you have to make the two questions, Answer == "Stand" or Answer == "stand", as I don't have the methods, I will print something just to you can see what is called:
def pullCard():
    print("You pulled a {r} of {s} the value is {v}")
    print("The dealer pulled a {dr} of {ds} the value is {dv}")

pullCard()

Answer = input('Do you want to Hit or Stand?')

if Answer == 'Stand' or Answer == 'stand':
    print("dealerOnly()")
if Answer == 'Hit' or Answer == 'hit':
    print("pullCard()")

you can also simplify the if like this:
Answer = input('Do you want to Hit or Stand?').lower()

if Answer == 'stand':
    print("dealerOnly()")
if Answer == 'hit':
    print("pullCard()")

