Mailing List Archive

Is this AI
I have created a program in Python

Is my Program Artificial Intelligent ?

In this I train the program to answer my question
Eg 1:

Training
0,0,0,1 ----> Ans is 0
0,0,1,0------> Ans is 1
0,1,1,0------> Ans is 1

You can observe ans is 3rd Element

Testing

0,0,1,0 ------> Ans ?

It gives 1

Eg 2:

Training
1,0,0,1 ----> Ans is 1
0,1,1,0------> Ans is 0
0,1,1,1------> Ans is 0

You can observe ans is 1st Element

Testing

1,1,0,0 ------> Ans ?

It gives 1


This is the program
---------------------------------------
weight=[0,0,0,0]

for i in range(0,3):
quesfortraining=[]

for k in range(0,4):
quesfortraining.append(int(input("Enter Training Ques"+str(i+1)+" Element "+str(k+1)+"---> ")))


ansfortraining=int(input("Enter Ans for Q"+str(i+1)+"---> "))


for j in range(0,50):
for l in range(0,4):

if quesfortraining[l]==ansfortraining:

weight[l]=weight[l]+1
else:
weight[l]=weight[l]-1

userques=[]


for i in range(0,4):
userques.append(int(input("Enter Your Real Question "+"Element "+str(i+1)+" ---> ")))


print("Answer is")
print(userques[weight.index(max(weight))])


---------------------------------------

--
https://mail.python.org/mailman/listinfo/python-list
Re: Is this AI [ In reply to ]
This is probably more ML then AI.

On Thu, Aug 6, 2020, 7:57 PM <yashvats8@gmail.com> wrote:

> I have created a program in Python
>
> Is my Program Artificial Intelligent ?
>
> In this I train the program to answer my question
> Eg 1:
>
> Training
> 0,0,0,1 ----> Ans is 0
> 0,0,1,0------> Ans is 1
> 0,1,1,0------> Ans is 1
>
> You can observe ans is 3rd Element
>
> Testing
>
> 0,0,1,0 ------> Ans ?
>
> It gives 1
>
> Eg 2:
>
> Training
> 1,0,0,1 ----> Ans is 1
> 0,1,1,0------> Ans is 0
> 0,1,1,1------> Ans is 0
>
> You can observe ans is 1st Element
>
> Testing
>
> 1,1,0,0 ------> Ans ?
>
> It gives 1
>
>
> This is the program
> ---------------------------------------
> weight=[0,0,0,0]
>
> for i in range(0,3):
> quesfortraining=[]
>
> for k in range(0,4):
> quesfortraining.append(int(input("Enter Training Ques"+str(i+1)+"
> Element "+str(k+1)+"---> ")))
>
>
> ansfortraining=int(input("Enter Ans for Q"+str(i+1)+"---> "))
>
>
> for j in range(0,50):
> for l in range(0,4):
>
> if quesfortraining[l]==ansfortraining:
>
> weight[l]=weight[l]+1
> else:
> weight[l]=weight[l]-1
>
> userques=[]
>
>
> for i in range(0,4):
> userques.append(int(input("Enter Your Real Question "+"Element
> "+str(i+1)+" ---> ")))
>
>
> print("Answer is")
> print(userques[weight.index(max(weight))])
>
>
> ---------------------------------------
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list