I am brand new to coding / programming and am starting with the foundations of Python. I've used a few different resources (Codecademy, Automate the Boring Stuff, and most recently, How to Think Like a Computer Scientist by Using Python).
So far my education has been good, albeit a bit slow to start (not used to thinking in computer terms quite yet!). But I've run into a problem with one of the lessons that I cannot replicate in my IDE. Please see the code below:
def printTwice(bruce):
print('bruce')
print('bruce')
Add printTwice('bruce')
on a new line after the function, with no indentation like so:
def printTwice(bruce):
print('bruce')
print('bruce')
printTwice('bruce')
This line will call your printTwice
function, passing the value 'bruce'
to the variable bruce
, which is not used.