#๐Ÿ”’ missing something here..

33 messages ยท Page 1 of 1 (latest)

bitter imp
#

PlayListRatings = [10, 9.5, 10, 8, 7.5, 5, 10, 10]

i=0
currPost=PlayListRatings[0]

while (i<len(PlayListRatings) and currPost >=6):

print(currPost)
i=i+1
currPost=PlayListRatings[i]

I am trying to get this to run but i'm not getting anything back . Could someone let me know what i'm doing wrong?

paper walrusBOT
#

@bitter imp

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

sterile lark
#

can you describe the expected logic?

#

from a glance it seems like you're trying to print all ratings 6 or above

bitter imp
#

I was hoping to get the the list to be printed out until it hit a value of less than 6

#

yes

sterile lark
#

!e

ratings = [10, 9.5, 10, 8, 7.5, 5, 10, 10]
for rating in ratings:
    if rating < 6:
        break

    print(rating)
paper walrusBOT
sterile lark
#

like that?

#

the way you were looping over the values seemed overcomplicated

bitter imp
#

yes i'm working a problem from coursera , i am suppose to use a while loop to get the output . i shold have mentioned that...

sterile lark
#

sounds like a badly formed exercise then because a while loop is not ideal here

#

but let me try

bitter imp
#

I appreicate any help.

sterile lark
#

!e

ratings = [10, 9.5, 10, 8, 7.5, 5, 10, 10]
i = 0
while ratings[i] >= 6 and i < len(ratings):
    i += 1
    print(rating)
#

!e

ratings = [10, 9.5, 10, 8, 7.5, 5, 10, 10]
i = 0
while ratings[i] >= 6 and i < len(ratings):
    print(ratings[i])
    i += 1
paper walrusBOT
bitter imp
#

I think i have asked you before but would you have any suggestions to where i could get affordable course work . It seems coursera is outdated...

sterile lark
#

!resources

paper walrusBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

bitter imp
#

!resources

paper walrusBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

sterile lark
#

what are you trying to do?

bitter imp
#

I am trying to get to a point to where i can get hired as a junior data base admin. but my last entry in this chat was to see if that e! thing was how you bring up the resources.

sterile lark
#

I meant that !e you tried to use

bitter imp
#

gotcha haha

sterile lark
#

but I already typed that command and the bot responded

#

then you did the same and the bot gave the same answer

bitter imp
#

i'm new to discord so i'm just testing stuff out

sterile lark
#

ok

bitter imp
#

i appreciate your help , i feel stupid asking some of these quesoins

paper walrusBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.