r/pythonhelp • • Apr 07 '21

Misunderstanding Functions: Keyword Arguments with Default Parameters

Hi. Working MIT 6.0001

Chapter 4.1.2 in the John Guttag Text

I'm having trouble understanding how to interpret the boolean here? In the first line of the body:

###########

if reverse:

print('Olga', 'Puchmajerova' )

###############

If reverse evaluates to True?

Or is it saying whatever you defined as the default parameter is a constant, and if the argument taken by the function is equivalent to that value, its true? So basically if you input false, then it evaluates to true? If you input True it's else?

I'm super confused here.

2 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/Akshaykadav Apr 09 '21

Can I ask how you did it, because for some reason I get a sub notification but the count doesn't increase and its happening a lot lately.

1

u/Remarkable-Avocado44 Apr 09 '21

hmmm I opened the youtube app on my phone, followed your link and hit subscribe... not sure what thats about!

1

u/Akshaykadav Apr 09 '21

Yeah, maybe youtube takes a few days to update the sub count.

1

u/Remarkable-Avocado44 Apr 24 '21

Did it go up?

1

u/Akshaykadav Apr 24 '21

Yup it takes around a day to actually update. Thanks for the follow up though 😊