O GoConqr está de visual novo! Conte para nós o que você achou.

Módulo 10 de 13 · Texto

LAB

David Khieu

LAB

Objectives

  • becoming familiar with the concepts of numbers, operators and arithmetic operations in Python
  • understanding the precedence and associativity of Python operators, as well as the proper use of parentheses. 

Scenario

Your task is to complete the code in order to evaluate the following expression:

The result should be assigned to y. Be careful - watch the operators and keep their priorities in mind. Don't hesitate to use as many parentheses as you need. 

You can use additional variables to shorten the expression (but it's not necessary). Test your code carefully. 

Test Data

Sample input: 1

expected output: 

 

y = 0.6000000000000001

Sample input: 10

Expected output:

 

y = 0.009999000199950014

Sample input: -5

Expected output:

 

y = -0.19258202567760344

Code I wrote:

x = float(input("Enter value for x: "))

y=1/(x+(1/(x+(1/(x+(1/x))))))# Write your code here.

print("y =", y)

Instruções

Para avançar no curso, envie uma tentativa deste quiz. Você pode enviá-la depois da última pergunta.

Ir para o módulo escolhido

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?