Relatively simple and clean language to learn that can be used to automate tasksCan y'all explain why folks recommend people in IT infrastructure/Networking to learn Python?
@kevm3 @Obreh Winfrey
Relatively simple and clean language to learn that can be used to automate tasksCan y'all explain why folks recommend people in IT infrastructure/Networking to learn Python?
@kevm3 @Obreh Winfrey
Is Python the industry standard now?Relatively simple and clean language to learn that can be used to automate tasks
for x in range(10):
if x % 2 == 0:
continue
print(x)
Can someone explain to me why this code in Python:
prints 1, 3, 5, 7, 9 ?
I originally read it as saying if x is divisible by 2, continue past (skip) the for condition. But it is actually saying, check is x is divisible by 2, and if it is, pass that batch and print the other numbers?
I'm just starting out and this is my first time engaging with the continue function
Looks kinda like block coding. Pretty cool.In my game I'm using a visually scripting language called Blueprints. Here is a screenshot of what the code looks like (not mine)
You could imagine this shyt is a nightmare for large, complex code. I've implemented alot of features that work as intended but the code is ugly as fukk. One of these days I'm gonna have to spend hours cleaning shyt up.
Continuing from kevm3, in my experience you generally won't see the continue keyword used. The if statement will usually be written with x%2==1. Further to the point, don't use the goto keyword if Python has it because you create the spaghetti code effect. You should try as much as possible for a one entry, one exit rule for your functions. My first CS professor hit me with theCan someone explain to me why this code in Python:
prints 1, 3, 5, 7, 9 ?
I originally read it as saying if x is divisible by 2, continue past (skip) the for condition. But it is actually saying, check is x is divisible by 2, and if it is, pass that batch and print the other numbers?
I'm just starting out and this is my first time engaging with the continue function
def list_benefits():
return ["More organized code", "More readable code", "Easier code reuse", "Allowing programmers to share and connect code together"]
# Modify this function to concatenate to each benefit - " is a benefit of functions!"
def build_sentence(benefit):
return "{} is a benefit of functions!".format(list_benefits[0], list_benefits[1], list_benefits[2], list_benefits[3])
def name_the_benefits_of_functions():
list_of_benefits = list_benefits()print(build_sentence(benefit))
for benefit in list_of_benefits:
name_the_benefits_of_functions()
def list_benefits():
return "More organized code", "More readable code", "Easier code reuse", "Allowing programmers to share and connect code together"
# Modify this function to concatenate to each benefit - " is a benefit of functions!"
def build_sentence(benefit):
return "%s is a benefit of functions!" % benefit
def name_the_benefits_of_functions():
list_of_benefits = list_benefits()
for benefit in list_of_benefits:
print(build_sentence(benefit))
name_the_benefits_of_functions()
Practice honestly. When you run into roadblocks Google it or ask here.Question for you guys in college/graduated or just people who learned how to program:
What tools did you guys use besides reading books?
I had a programming assignment due friday and i turned it in incomplete because for the life of me I could not figure out how to put the code together.
Something like Chegg, but not like Chegg cause I used them before
then i have a test tomorrow
Programming is basically writing step by step instructions. As long as you can think sequentially you'll be fine. Pay attention, start assignments early and don't wait until a day or two before they're due and you'll be fine.Bout to start this java class on Monday. Already ran through most of the free classes on code academy this weekend. You breh got any tips or suggestions
how many hours a day would you recommend practicing? outside of regular class assignments.Programming is basically writing step by step instructions. As long as you can think sequentially you'll be fine. Pay attention, start assignments early and don't wait until a day or two before they're due and you'll be fine.
I don't have an answer for that because I never really practiced programming. Usually your class assignments will be enough. The only way to properly practice is to work on projects but if you're coming into this with no prior knowledge then doing more work on the side can be overwhelming. Don't stress on it too much.how many hours a day would you recommend practicing? outside of regular class assignments.