Python Forum
what's wrong? i know this is simple
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what's wrong? i know this is simple
#4
Tried moving the assignment out of the while statement. made no sense with it there. should be at top.

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

import os

repeat = "y"
input("set mypassword")
mypassword = "test123"

while repeat=="y":
    input("stsart while")

    guesspassword = input("What is the password: ")
    if guesspassword==mypassword:
        input("start if")
        print("match")
        input("Press Enter")

    else:
        input("start else")
        print("no match")
        print("Password is ", mypassword)
        input("Press Enter")

    repeat = input("Run again?")
    os.system('cls')
Reply


Messages In This Thread
what's wrong? i know this is simple - by davidorlow - Mar-15-2023, 12:47 AM
RE: what's wrong? i know this is simple - by davidorlow - Mar-15-2023, 01:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 515 Nov-07-2023, 04:32 PM
Last Post: snippsat
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,646 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  python gives wrong string length and wrong character thienson30 2 3,050 Oct-15-2019, 08:54 PM
Last Post: Gribouillis
  simple dragon realm gone wrong Darbandiman123 7 5,606 Mar-01-2017, 05:25 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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