Python_Programming_Week4
1. Write a program “Lab4B” that prompts the user to enter a string and then: 1. Display the length of the string. 2. Convert all the vowels into lowercase and display the modified string. 3. Display a count of each of the vowels and the total number of vowels in the string. 4. Convert the string into list of words and display the length of the list. (Note: the input vowels may be either uppercase or lowercase letters.) 2. Write a program “Lab4B”that keeps prompting the user (until input of 0) for a distance in meters and then displays that distance converted to miles, feet and inches*. Please note that the value to be converted to feet in this problem is the decimal portion of the number of miles, and the value to be converted to inches is the decimal portion of the number of feet. It is not sufficient to simply convert the entire distance in meters to miles, feet and inches, respectively. HINT: use can use the Python int() function to return the decimal portion of your calculation for miles, feet and inches. Test with 5000 meters. Show that result in your screenprint. *1 meter = 0. miles. 1 mile = 5280 feet. 1 foot = 12 inches.
Escuela, estudio y materia
- Institución
- Python Programming
- Grado
- Python Programming
Información del documento
- Subido en
- 22 de julio de 2023
- Número de páginas
- 3
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
pythonprogrammingweek4
Documento también disponible en un lote