Heskan's first code

I am the proud father of…
#Decision Maker v1.3.2
import random
indexYes = 0
indexNo = 0
user = input(“Enter a question:”)
result = user.find(’?’)
print(user)
if (user.find(’?’) != -1):
value = random.random()
if round(value) == 1:
print(“Yes”)
indexYes = indexYes + 1
else:
print(“No”)
indexNo = indexNo + 1
print("===========================================")
print(“Yes-Counter:”)
print(indexYes)
print(“No-Counter:”)
print(indexNo)

while (user != 'end') == True:
    print("")
    user = input("Enter another question:")
    result = user.find('?')
    print(user)
    if (user.find('?') != -1):
        value = random.random()
        if round(value) == 1:
            print("Yes")
            indexYes = indexYes + 1
        else:
            print("No")
            indexNo = indexNo + 1
        print("===========================================")
        print("Yes-Counter:")
        print(indexYes)
        print("No-Counter:")
        print(indexNo)
    else:
        if (user.find('end')!= -1):
            print("machine ended sucessfully.")

        else:
         print("? not found")

else:
if (user.find(‘end’) != -1):
print(“machine ended sucessfully.”)

else:
    print("? not found")

while (user != 'end') == True:
    print("")
    user = input("Enter another question:")
    result = user.find('?')
    print(user)
    if (user.find('?') != -1):
        value = random.random()
        if round(value) == 1:
            print("Yes")
            indexYes = indexYes + 1
        else:
            print("No")
            indexNo = indexNo + 1
        print("===========================================")
        print("Yes-Counter:")
        print(indexYes)
        print("No-Counter:")
        print(indexNo)
    else:
        if (user.find('end')!= -1):
            print("machine ended sucessfully.")

        else:
         print("? not found")

Help i need more sleep

“Whoa nice code”
“Good!”
“You dont need sleep, just efficiency!”

shut your loser mouth

What is this?

Make magic 8ball, real easy like

Im currently struggeling with a number sorter that is capable of sorting x amount of numbers

Just make random number
With multiple if statements for every output

ayyy
this outputs an array out of bounds error. the yellow-hoghlighted value says cannot define ‘value’
pls help

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.