has always been not like development, but also more exclusive, so the University of Professional choice of network engineering. But the college does not attach importance to the network, the senior internship when all to training and development only I chose to continue along the network direction go down. It has been working for over a year now, and the needs of traditional network engineers have been very small. In the end, I went back to the development, chose Python, and started my life's new journey.
This is the longest piece of code I've written so far, and there's a lot of imperfections that I want the big guys to guide me a little Beginner
#Author:tannarproduct_list = [ (' Iphone ', 5800), (' Mac pro ', 12888), (' IWatch ', 10600), (' Bike ', 7777), (' Python ',, ) (' Tea ')]shopping_list = []price = 0salary = input ("\033[41;1minput your salary:\033[0m") if salary.isdigit (): salary = int (Salary) while True: for index, item in enumerate (product_list): print (Index, item) user_choice = input ("\033[43;1m Select item to buy >>>:\033[0m") if user_choice.isdigit (): user_chOice = int (User_choice) if user_choice < len (product_list) and user_choice >= 0: p_item = product _list[user_choice] if p_item[1] <= salary: shopping_list.append (P_item) salary -= p_item[1] price += p_item[1] &nbsP; print ("\033[45;1madded %s into shopping cart, your current salary is %s\033[0m "% (p_item[0],salary)) else: print ("\033[44;1m your balance is insufficient \033[0m") else: print ("\033[44;1mproduct code is not exist\033[0m ") elif user_choice == ' Q ': print ("\033[44; 1m--------------shopping list-----------------\033[0m ") for p in shopping_list: print (P) print ("The totally price is ", Price) print ("your current balance is ", salary) exit () else: print ("\033[41;1minvalid input\033[0m") else: print ("\033[41;1minvalid input\033[0m")
My path to Python learning (day1)