Join this and ask questions if you need it
we ready using this one https://discord.gg/uSUe2d
could you use break instead of return because it does not need to return a number
I have the exact same coding line for line but it isn't running super confusing
^ Same here
you have to type Main()
File "<pyshell#2>", line 1, in <module>Main()File "C:\Users\alyja\Desktop\Python\Factorial.py", line 19, in MainN = EnterPositive( "Enter a positive integer: " )NameError: name 'EnterPositive' is not defined
I type in Main() and get that
everything is perfect but ill keep trying
so return is necessary to put in all functions regardless of whether theres a value to return?
wouldn't that only run Main once and then end the program
so that you can the same thing again if you need to
Aman Saiju (he/him)
So that we can easily rerun parts
it makes it easier for reuse again for larger programs
it makes recalling different steps that need to be used multiple times easier
so others can use it
it is more organized
To avoid retyping everything every time
how come you don’t have to include print() with “enter a positive integer”?
In BASIC you can open sublets of the main program to help you organize, and then call it into the main screen. Can you do that in Python or is it just done with functions?
can we enter a command in the main code to automatically run a function without having to call for it?
Can you go over how to get the code you entered in python to run?
Uzair you could use a while loop to recall with certain conditions
Great, thanks Christina
its the recall on the first
why do you need the Q =?
this made more sense to what return do now
why would you need to compute toad if you never print that and it wasn't involved in computing Z
what do the variables in the main program (frog, toad, Q) do?
Was s equal to 3 first and then equal to 5?
If you wrote Z=MyFunction(Frog), then would the other variables not be accessible in the function?
nothing to define R
Aman Saiju (he/him)
thank you professor