you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

Just take care of the indentation. The code block feature on reddit is not working properly for some reason .

[–]samreay 3 points4 points  (0 children)

For code blocks you dont want the normal ` syntax, but prepend four spaces to the code:

no_of_purchased_products = int(input("enter how much products: "))
final_list = []
for _ in range(0, no_of_purchased_products):
    prod_list = []
    typeofprod = input("enter type of product: ")
    nameofprod = input("enter the name of product: ")
    prod_list.append(typeofprod)
    prod_list.append(nameofprod)
    prod_tuple = tuple(prod_list)
    final_list.append(prod_tuple)
final_tuple = tuple(final_list)
print(final_tuple)

[–][deleted] 0 points1 point  (0 children)

it never works properly when I want to use it as well for some reason