I am making a keyboard in python cause why not, but when the second def is called it prints var2 the way I want but not var1 some code
baseLetter = ("a")
letter1 = (baseLetter)
letter2 = (baseLetter)
def letter002():
letter2 = input("")
if letter2 == ("a"):
letter2 = ("a")
print("{}{}".format(letter1, letter2))
elif letter2 == ("b"):
letter2 = ("b")
print("{}{}".format(letter1, letter2))
elif letter2 == ("c"):
letter2 = ("c")
def letter001():
letter1 = input("")
if letter1 == ("a"):
letter1 = ("a")
print("output - {}".format(letter1))
letter002()
elif letter1 == ("b"):
letter1 = ("b")
print("output - {}".format(letter1))
letter002()
elif letter1 == ("c"):
letter1 = ("c")
print("output - {}".format(letter1))
letter002()
a small sample of code. main.py is only used to call this so it shouldn't change anything. I have tried putting all of the code on main.py but the same thing.
main.py is just letter001.letter001()
and importing file letter001
I try to make it say "cb"
when I type for letter1 it gives me "c"
when I type for letter2 it gives me "ab"
I can't get rid what sets letter1 and letter2 to a certain letter or it won't work.
I am relatively new so don't really know exactly what I am doing, and I have tried to look up a solution but nothing.