understandable versions of Question:
- How to detect and get strings inside of parenthesis?
- How to detect and get datatypes inside of parenthesis?
- How to detect and get strings inside of parenthesis using If?
- How to detect and get datatypes inside of parenthesis using if?
example:
x = input("send command(only allow 1 digits of character and only allow A,B<C<D<E<and F)")
if x == "$C A":
print(x)
elif x == "$C B":
print(x)
...
6 possibilities(if and elif statements)
tried: using rfind method, rpartition method translate method(translate from parenthesis to curly brackets), used format() method, used str() function
my code(with if statements):
def commandLine():
c = input()
if c = "$CR -f a"
print("you made a file named a")
elif c = "$CR -f A"
print("you made a file named A")
...
possibilites: 15,000 or 7,000
lazy code:
def commandLine():
c = input()
if c = "$CR -f"
f = input("filename: ")
print(f)
possibilites with short code: Infinity(infinite characters can be typed in the f=input() variable)