Oct-25-2016, 05:00 AM
Hello Friends,
I would like to get my list to print out horizontally and have spaces in between on a new line like this:
10 15 25 30
25 30 45 60
81 92 81
The last line does not need to be separated evenly like the other two. The user is able to enter in any amount.
Here is the code:
Thank you in advance! =)
I would like to get my list to print out horizontally and have spaces in between on a new line like this:
10 15 25 30
25 30 45 60
81 92 81
The last line does not need to be separated evenly like the other two. The user is able to enter in any amount.
Here is the code:
def Grades(amount): import random for i in range(0, amount): empty_list = [] grade_list = amount*empty_list comb_list = grade_list.append(random.randint(0,100)) print(grade_list) #str_create = str(Grades(5)) #print(len(str_create)) def Rows(grade_list): grade_list_string = str(Grades(10)) for i in range(0, len(grade_list_string)): pos_slice = grade_list_string[0:2] print(pos_slice) Rows(1)
Thank you in advance! =)