Hi there. I am fairly new with python and programming altogether. I'm having a problem dividing elements of two lists, and appending the results to a new list. The problem is, the second list may contain a zero, and obviously we can't divide by zero. If it happens that we need to divide by zero, I'd just like to append a zero in my new list for that position. Below I have posted my final attempt at trying to code this. I'm getting an invalid syntax at "if b==0:". Any help will be much appreciated.
a = [3, 7, 6, 4]
b = [1, 7, 0, 2]
#Expected result after dividing a by b
# c = [3, 1, 0, 2]
count = 0
c = 
d = 0
while count < len(a):
if b ==0: #invalid syntax error
count = count + 1
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...