Python Forum
why doesnt the while loop run?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why doesnt the while loop run?
#1
hi there super beginner here and trying out the rock paper scissors game question using python
just the first portion is posted since the rest should be similar
however it seems that the while loop first line is not even activated, why is this so?

first = input ("rock paper scissors?: ")
second = input ("rock paper scissors?: ")
rock = 5
paper = 10
scissors = 15
print(rock)

while first == 5:
    print ("activated")
    if second == 15:
        print ("congrats player 1")
        break
    elif second == 10:
        print ("congrats player 2")
        break
    else:
        print ("draw")
        continue
thank u very much in advance!!!
Reply


Messages In This Thread
why doesnt the while loop run? - by supermane - Aug-03-2018, 07:36 AM
RE: why doesnt the while loop run? - by wavic - Aug-03-2018, 08:06 AM
RE: why doesnt the while loop run? - by supermane - Aug-04-2018, 04:58 AM
RE: why doesnt the while loop run? - by wavic - Aug-04-2018, 06:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have two Same Code but One of them Doesnt Work beginner721 6 3,096 Jan-22-2021, 10:56 PM
Last Post: beginner721
  code doesnt return anything ofrihemo 3 2,048 Jun-30-2020, 05:14 PM
Last Post: ofrihemo
  Why does this work and this doesnt= puruvaish24 1 2,604 May-22-2018, 03:58 AM
Last Post: scidam
  Python code doesnt run tsetsko 3 3,798 Sep-02-2017, 01:47 PM
Last Post: tsetsko

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020