I need to create a code that asks for the user to input gigahertz, cores, and ask if there is hyper-threading, then prints the performance of the cpu (high/med/low) based on the chart below. I know it is something with strings being truthy in Python but I have tried every suggestion I can find to fix it!
giga = float(input("Enter CPU gigahertz:\n"))
core_count = int(input("Enter CPU core count:\n"))
hyper = input("Enter CPU hyperthreading (True or False):\n")
if hyper == "true" or "True":
if giga >= 1.9 and giga < 2.4:
if 4>core_count>=2:
print("\nThat is a low-performance CPU.")
elif giga >= 2.4 and giga < 2.7:
if core_count>=4 and core_count <6:
print("\nThat is a medium-performance CPU.")
elif 4>core_count>=2:
print("\nThat is a low-performance CPU.")
elif giga >= 2.7:
if core_count>=4 and core_count <6:
print("\nThat is a medium-performance CPU.")
elif core_count>=2 and core_count < 4:
print("\nThat is a low-performance CPU.")
elif core_count >= 6:
print("\nThat is a high-performance CPU.")
elif giga < 1.9 or core_count < 2:
print("\nThat CPU could use an upgrade.")
if core_count>=20:
print("\nThat is a high-performance CPU.")
elif hyper == "False":
if giga >= 2.4 and giga < 2.8:
if core_count >= 2 and core_count < 6:
print("\nThat is a low-performance CPU.")
elif giga >= 2.8 and giga < 3.2:
if core_count >= 6 and core_count < 8:
print("\nThat is a medium-performance CPU.")
if core_count <6:
print("\nThat is a low-performance CPU.")
elif giga >= 3.2:
if core_count >= 8:
print("\nThat is a high-performance CPU.")
if core_count >= 6 and core_count < 8:
print("\nThat is a medium-performance CPU.")
if core_count <6:
print("\nThat is a low-performance CPU.")
elif giga < 2.4 or core_count < 2:
print("\nThat CPU could use an upgrade.")
all of my other outcomes work it is only when the inputs are something # like giga = 2.8 core_count = 6 hyper = false
it should print "medium-performance cpu" but it recognizes true and prints high-performance