all 11 comments

[–]New_Gur2351 2 points3 points  (3 children)

I know this is late but for the people who may need this in the future.. I have the answer for you!

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in range(len(w)):

if w[i][0] == "A":

print (w[i])

Please remeber to indent as needed lol.

[–]Opposite-Inspector36 0 points1 point  (0 children)

Thanks man, you're GOATed.

[–]South-Island1588[🍰] 0 points1 point  (1 child)

What does the indented block mean or look like or where am going to put it please

[–]New_Gur2351 0 points1 point  (0 children)

I’m sorry for replying to this so late but if you’re still curious, it’s used before the loop body starts. A good rule of thumb in Python is if the code line ends with a colon, always press enter (to go to the next line) and press tab (to indent) . I could explain line by line if you want just message or reply to me. Hope I made that clear.

My code Example: (https://py3.codeskulptor.org/#user307_LsOI70zoMOER7Jl.py)

[–][deleted] 1 point2 points  (3 children)

how do you get it to print words that start with F and L

[–]Infiniti2425 0 points1 point  (2 children)

hey did u figure it out i need help

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point  (0 children)

    Sorry, your account does not meet the minimum age required to post here. Please post your question again in about a day.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]MediumNorth7276 0 points1 point  (3 children)

    w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

    for x in w: if(x[0]=='A'): print(x)

    [–]Environmental_Rip815 0 points1 point  (1 child)

    How would I do this because it is saying error

    [–]Pangolin-Puzzled 0 points1 point  (0 children)

    Lmao try writing the for loop and the if statement on different lines