Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for question
#1
Hello guys, i have a noob question. Could you help me please ?

I would like to do when i press + key, my values should change respectively ? Thanks.

1. press a
2. press b
3. press c

a = {"1":"a", "2":"b", "3":"c"}

while True:
    x = input("Press +")

    for i in a.values():
        if x == "+":
            print (i)
Reply
#2
I read this a few times but can't understand what it is you want to do.
Are you able to explain more clearly.
Reply


Forum Jump:

User Panel Messages

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