How to stop the program as soon as one of the condition is met

2012-04-16 Thread Chinesekidz
Hello Guys: How can I stop the program as soon as one of the condition is met? Here is example: The loop should be stop asking for more input if a=b or c=6. I tried to write one but it only stop when a=b and not when c=6 Please help me -- http://mail.python.org/mailman/listinfo/python-li

how to count the total number of strings (in the list) used in Python?

2012-04-16 Thread Chinesekidz
Hello! I would like to know how to write the program to count the total number of strings (in the list) used in Python.. for example: list:['1','2','3','4'] for l in range(4): num=input("list:"+list[l]+"(between 1 and 4):") if num.isdigit: tnum=tnum+int(num) print("Total numb

how to count the total number of strings (in the list) used in Python?

2012-04-16 Thread Chinesekidz
Hello! I would like to know how to write the program to count the total number of strings (in the list) used in Python.. for example: list:['1','2','3','4'] for l in range(4): num=input("list:"+list[l]+"(between 1 and 4):") if num.isdigit: tnum=tnum+int(num) print("Total numb