def findmaxnumbers(numbers): print(f"calling function findmaxnumber with:{numbers}") print("setting currentmax to 0") Currentmax = 0 print("looping through list of numbers") for n in numbers: print(f"checking the current number: {n} to see if it is greater than {currentmax}") if n > Currentmax: print(f"updating currentmax to {n}") Currentmax = n whats wrong with it when i hit run nothing pops up
Please watch the next video, I point out a great debugging trick that will help you find why nothing happens. Or simply rewatch the video where I show you how to use this function.
hey I keep getting this error at example 1 File "main.py", line 2 currentMax = 0 IndentationError: expected an indented block after function definition on line 1. can someone help? thanks
question. should I be following along with the video in replit. And if i didnt really understand what was going on should i keep rewatching until i grasp this content or move on to the next video where it explains this more
great lesson. I've tried to do the code and I ran into an issue where it doesn't loop through all the numbers. Below is my code and it is similar. Not sure why it does not check all 5 numbers: print("Lesson 2: Print Statements in Code Dialogue") def findMaxNumber(numbers): print (f"Calling function findMaxNumber with: {numbers}") print ("Setting currentMax to 0") currentMax=0 print(f"Looping through the list of numbers") for n in numbers: print(f"Checking the current number: {n} to see if it is greater than {currentMax}") if n > currentMax: print(f"Updating currentMax to {n}") currentMax = n return currentMax print (findMaxNumber([1,2,3,4,5]))
Yes, for n in numbers, is the looping logic. Don't worry if this didn't make sense, we will cover loops in a future lesson. This was just an example to help show the power of debugging
Think of it as a placeholder, fill in the blank kind of sentence structure. This video was made relatively new, but in the next lesson I believe strings will be covered in more detail
def findmaxnumbers(numbers):
print(f"calling function findmaxnumber with:{numbers}")
print("setting currentmax to 0")
Currentmax = 0
print("looping through list of numbers")
for n in numbers:
print(f"checking the current number: {n} to see if it is greater than {currentmax}")
if n > Currentmax:
print(f"updating currentmax to {n}")
Currentmax = n
whats wrong with it when i hit run nothing pops up
Please watch the next video, I point out a great debugging trick that will help you find why nothing happens. Or simply rewatch the video where I show you how to use this function.
hey I keep getting this error at example 1 File "main.py", line 2 currentMax = 0
IndentationError: expected an indented block after function definition on line 1. can someone help? thanks
Please share all of your code or join the discord and share it there
question. should I be following along with the video in replit. And if i didnt really understand what was going on should i keep rewatching until i grasp this content or move on to the next video where it explains this more
Just move on, this video is just teaches you how to debug your code as you progress
great lesson. I've tried to do the code and I ran into an issue where it doesn't loop through all the numbers. Below is my code and it is similar. Not sure why it does not check all 5 numbers:
print("Lesson 2: Print Statements in Code Dialogue")
def findMaxNumber(numbers):
print (f"Calling function findMaxNumber with: {numbers}")
print ("Setting currentMax to 0")
currentMax=0
print(f"Looping through the list of numbers")
for n in numbers:
print(f"Checking the current number: {n} to see if it is greater than {currentMax}")
if n > currentMax:
print(f"Updating currentMax to {n}")
currentMax = n
return currentMax
print (findMaxNumber([1,2,3,4,5]))
Nevermind! I corrected myself lol
Confused with the
if n > current max
It always says indentation error
Can someone help?
Check your spaces, look very closely at the code
Thank you for the advice bro ! It makes coding more fun and easy 🥳
Of course :) glad it's more fun!
You deserve way more recognition.
Thanks appreciate the kind words ☺️
Where was "looping through the list of numbers"came from...was it "for n in numbers:"
Yes, for n in numbers, is the looping logic. Don't worry if this didn't make sense, we will cover loops in a future lesson. This was just an example to help show the power of debugging
First of all how do you get this page 1 to 9 it's my first day doing practical here
What is page 1 to 9? Please watch the series from the first video!
Ok boss
Nice video! Just a little confused as to what the "f" string is used for.
Think of it as a placeholder, fill in the blank kind of sentence structure. This video was made relatively new, but in the next lesson I believe strings will be covered in more detail
Great and Informative video. Time to practice and play alittle inside my code editor🚀
Yes that's the best way to learn 😊
Great Lesson, thanks for the insight on Debugging :)
Hope you learned something new that will help you along your journey :)
It's not running i only get a box what did i do wrong thanks
I'm not sure, you didn't share enough information for me to help :/ maybe the next video in the series would help
Sorry i was able to correct the syntax but still not running console is just blank and can i copy and paste what i did thank you@@CodewithVincent
Drop it in the discord channel. I'm more active there
Awesome Video!
Thank you! 😊
this aint workin
It works, you didn't copy all of the code
@user-hhif4ur7y, I thought the same, I just didn’t realize I didn’t copy lines 12 and 14, late but hope it helps
how to start what is the website i can start from
Please watch the series from the beginning
Hi, I'm just starting to learn coding to get my goal as a Software Engineer. Can I get your discord link?
Check the video description