The conditions that you have work as (unitType == "C") or "c"
and that is not what you want. Instead you want unittype in ("C", "c")
.
More Related Contents:
- How to get a function name as a string?
- Setting variables with exec inside a function
- I have a string whose content is a function name, how to refer to the corresponding function in Python?
- Reverse a string without using reversed() or [::-1]?
- Use a string to call function in Python [duplicate]
- Which is the preferred way to concatenate a string in Python?
- Is there a way to convert number words to Integers?
- Finding multiple occurrences of a string within a string in Python [duplicate]
- Why does using `arg=None` fix Python’s mutable default argument issue?
- unpacking function argument [duplicate]
- Is there an easy way to pickle a python function (or otherwise serialize its code)?
- Cannot concatenate ‘str’ and ‘float’ objects?
- Python string ‘in’ operator implementation algorithm and time complexity
- What is the naming convention in Python for variable and function?
- Python – difference between two strings
- Format string unused named arguments [duplicate]
- Function chaining in Python
- Converting a column within pandas dataframe from int to string
- efficiently checking that string consists of one character in Python
- Are strings cached? [duplicate]
- Titlecasing a string with exceptions
- How to remove leading and trailing zeros in a string? Python
- How is unicode represented internally in Python?
- Inserting the same value multiple times when formatting a string
- How to check a string for a special character?
- Possible to change a function’s repr in python?
- How to create raw string from string variable in python?
- Convert string into Date type on Python [duplicate]
- How to use str.contains() with multiple expressions in pandas dataframes
- How to merge two json string in Python?