Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 votes

I want to multiply each element in the list by "*" to get the right number of stars to output in the bar graph at the right spot.

Online help only gives help for multiply the WHOLE list by a SINGLE number... when i want to use the list's number to multiply by "*" to get the right stars for that list position.

any tips?

asked in CSC201 Spring 2021 by (8 points)
+1

I used For loop (range is the length of the list) to go through each number in the list. Then I used indexing to get each number and multiply that number by "*"

3 Answers

+2 votes

You will use indexing to get the number from the list and multiply that number *
Furthermore, you will use a for loop and the range will be the length of the list.

answered by (8 points)
+2 votes

You can multiply the first number by '*' using list[0]'*' , the second with list[1]'*' , ect. You can set up a for loop to do it as many times as there are items in the list.

answered by (8 points)
+2 votes

I used For loop (range is the length of the list) to go through each number in the list. Then I used indexing to get each number and multiply that number by "*"

answered by (8 points)
...