100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Python_Programming_Week7

Puntuación
-
Vendido
-
Páginas
3
Grado
A+
Subido en
22-07-2023
Escrito en
2022/2023

1. Write a Python program “Lab7B.py” to complete the following: • Define a method/function randoms_to_file(n, n1, n2, filename) such that n random integers (positive or negative) in the range of [n1, n2] are generated and will be written to the file with the name of “filename”. • Define a method/function read_file_and_process() such that: o Prompt for a filename of file to be opened for inputs, you need to use while-loop with try except in case of the incorrect input of the file name. o Read in all the “numbers” on the file (hints: you can only read in a string, so you need to use int() for conversion to integers). o A list of items is returned with items in this order in the list: ▪ The minimum number in the file ▪ The maximum number in the file ▪ The number of integers in the file ▪ The average of those numbers in the file ▪ (Hints: The largest integer is “ze”, the smallest is “-ze1”) • Implement a regular main() function such that: o Prompt for inputs of n, n1, n2, filename—see the above definitions for them. A while-loop with try-except is required to make sure of the correct inputs! Call function randoms_to_file(….) o Call function read_file_and_process() o Print the outputs (returned from the above call) o (Hints: use the following demo execution samples to guide your design and implementation of this project.)

Mostrar más Leer menos
Institución
Python Programming
Grado
Python Programming








Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

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

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
datascience24 Self
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
84
Miembro desde
3 año
Número de seguidores
16
Documentos
159
Última venta
1 mes hace

Please message me using Send Message option for new assignment requests.

4.5

12 reseñas

5
10
4
0
3
1
2
0
1
1

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes