[SOLVED] How to get integer or float values from a string in Python?
Hi, I want to create a program with Python that can calculate fahrenheit to celsius and celsius to fahrenheit according to user input. If the user gives 10C as string input, then the program will understand that the user wants to convert 10° Celsius (C) to Fahrenheit (F) (because user inputted C after 10). And then the program will take 10 as an integer or float and it will convert 10° celsius to fahrenheit. In the same way, if the user gives 10F as input, then the program will understand that the user wants to convert 10° Fahrenheit (F) to Fahrenheit (C) (because user inputted F after 10). And then the program will take 10 as an integer or float and it will convert 10° fahrenheit to celcius. If I want to do this, I have to take only 10 as integer or faulting number from the sting input 10C or 10F given by the user. How do I do it now? Example: 1. Input : 15.6C Expected Output: >>> 50.9°F 2. Input : 50.9F Expected Output: >>> 15.6°C [SOLVED] https://code.sololearn.com/cX53nLKNXOk2/?ref=app