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

Módulo 7 de 20 · Texto

Lab print()

David Khieu

LAB

Estimated time

5-10 minutes

Level of difficulty

Very Easy

Objectives

  • becoming familiar with the print() function and its formatting capabilities
  • experimenting with Python code.

Scenario

The print() command, which is one of the easiest directives in Python, simply prints out a line to the screen. 

In your first lab:

  • use the print() function to print the line Hello, Python! to the screen. use double quotes around the string
  • having done that, use the print() function again, but this time print your First name;
  • remove the double quotes and run your code. Watch Python's reaction. What kind of error is thrown? 
    • SyntaxError: invalid syntax
  • then, remove the parentheses, put back the double quotes, - and run your code again. What kind of error is thrown this time? 
    • No Error, Hello, Q David Khieu
  • experiment as much as you can. Change double quotes to single quotes, use multiple print() functions on different lines. See what happens. 

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?