Hi I'm new to Python and have been learning independently. However, although seemingly simple I can't get past this problem.
So I'm creating a very simple chart whereby I enter a list of numbers and get corresponding pipes (|) to match.
def chart(list):
for i in list:
print('|' * i)
chart([2,7,1,4,2,3,9,3])
Gives output:
||
|||||||
|
||||
||
|||
|||||||||
|||
However how would I do it so that the entered data "chart([2,7,1,4,2,3,9,3])" would not be done from the developed code itself? I tried:
def chart(list):
for i in list:
print('|' * i)
a = list(input("Enter List of nums: "))
chart([a]
But that error-ed? Any Solutions? Thanks for the help! (Ignore any indentation errors just typed it up without Python)