Computer Science Archive: Questions from February 19, 2023
-
Given a list of integers in a sequence construct and print a new list LE with only the square of even values. Must use list comprehension to construct the new list Por cjemplo: Respuesta: (sistema de2 answers -
Given a list, such as \( \mathbf{L}=[[1,2,3],[4,5,6]] \) write code to reference and print the first element of the list, i.e., \( [1,2,3] \) such as the output is: Por ejemplo: Respuesta: (sistema de2 answers -
Write a program to construct a 2D list with the elements below. Ask also your program to print the list. Respuesta: (sistema de penalización: \( 0,10,20, \ldots \% \) ) Reiniciar respuesta2 answers -
User input \( \mathbf{N} \) and your program constructs by the method of list comprehension a list of all values, such as \( \mathrm{L}=[2,4,6, \ldots N] \). Print the List. Por ejemplo: Respuesta: (s2 answers -
2. (40) Using your grammar for the above question, draw parse trees and syntax trees for: a) \( x+y *(-z-x)+z+b \) * \( d \) b) \( x={ }^{*} x+y{ }^{*}\left(x+{ }^{*} y\right) *(x-y) \) c) \( x=y=z=y-2 answers -
2 answers
-
2 answers
-
2 answers
-
Approximation with a series and factorial functions Write a program that calculates Pl with the expression π 1 2 2 N=00 (i!)22i+1 (2i + 1)! using the factorial function from the Python library as an
Pi Approximation with a series and factorial functions Escriba un programa que calcule PI con la expresión \[ \frac{\pi}{2}=\frac{1}{2} \sum_{i=0}^{N=\infty} \frac{(i !)^{2} 2^{i+1}}{(2 i+1) !} \] ut2 answers -
USE PYTHON Approximation with a series and factorial functions Write a program that calculates PI with the expression t 1 2 2 N=00 (il)22i+1 (2i + 1)! using the factorial function from the Python l
Pi Approximation with a series and factorial functions Escriba un programa que calcule PI con la expresión \[ \frac{\pi}{2}=\frac{1}{2} \sum_{i=0}^{N=\infty} \frac{(i !)^{2} 2^{i+1}}{(2 i+1) !} \] ut2 answers -
Use PYTHON Pl could be approximated with the product of nested radicals: Perhaps it might help to visualize the expression above as: 11 1 P Maybe in this other way: 2(0.5 sqrt(0.5) 2(0.5 sqrt(0.5+0.5
Compute pi with nested radicals: https://mathworld.wolfram.com/PiFormulas.html Pl podría ser aproximado con el producto de radicales anidados: \[ \frac{2}{\pi}=\sqrt{\frac{1}{2}} \sqrt{\frac{1}{2}+\f2 answers -
USE PYTHON Write a code in Python-3 to report the geometric mean (GM) of heights (x) of a team basketball with N-players. This average is defined as: The program must ask the user the number of player
Geometric Mean with a List Fsccribe un código en Python-3 para reportar el promedio geométrico (GM) de estaturas (x) de un equipo de baloncesto con \( \mathrm{N} \)-jugadores. Este promedio es defin3 answers -
2 answers
-
Pi Approximation with a series involving factorials Escriba un código en Python-3 para calcular PI con la expresión: \[ \frac{\pi}{2}=\frac{1}{2} \sum_{i=0}^{N=\infty} \frac{(i !)^{2} 2^{i+1}}{(2 i+2 answers -
2 answers
-
2 answers