Flashcards: Python Basics and Math Functions — 36 cartões

Todos os cartões

1Pergunta

What does the print() function display in Python output?

Resposta

Text, numbers, and evaluated expressions.

2Pergunta

Which quote styles can Python strings use?

Resposta

Single, double, or triple quotes.

3Pergunta

What can triple-quoted strings do that single or double quotes cannot?

Resposta

Span multiple lines.

4Pergunta

What does the escape sequence \n do inside a string?

Resposta

Inserts a line break.

5Pergunta

What is the result of the expression "python"*4?

Resposta

The string repeated four times.

6Pergunta

What does the built-in function abs() return?

Resposta

The absolute value of a number.

7Pergunta

What does pow(a,b) calculate?

Resposta

The value of a raised to the power of b.

8Pergunta

What does round(number,digits) do when digits is omitted?

Resposta

Rounds the number to the nearest integer.

9Pergunta

What does round(number,digits) do when digits is specified?

Resposta

Rounds the number to the given decimal places.

10Pergunta

What does ceil() return for a number?

Resposta

The smallest integer greater than or equal to the number.

11Pergunta

What does floor() return for a number?

Resposta

The largest integer less than or equal to the number.

12Pergunta

What does the factorial function return for an integer n?

Resposta

The product of all positive integers from 1 to n.

13Pergunta

What is the value of 5! (factorial of 5)?

Resposta

120

14Pergunta

What does 'import math' do in Python?

Resposta

It loads the math module for use with the math. prefix.

15Pergunta

How does 'from math import factorial, pi, log2' affect name usage?

Resposta

It allows using factorial, pi, and log2 without the math. prefix.

16Pergunta

What does 'import math as M' do?

Resposta

It assigns the alias M to the math module.

17Pergunta

How do you call square root using the alias M after 'import math as M'?

Resposta

By calling M.sqrt(25).

18Pergunta

What does 'from math import sqrt as jazr' do?

Resposta

It imports sqrt under the local alias jazr.

19Pergunta

How do you compute the square root of 25 using the alias jazr?

Resposta

By calling jazr(25), which returns 5.

20Pergunta

How does a compiler process code compared to an interpreter?

Resposta

A compiler processes the whole program before execution, an interpreter processes line by line.

21Pergunta

Which commands run Python files in Visual Studio Code?

Resposta

Run Python File and Run Without Debugging (Ctrl+F5) run Python files.

22Pergunta

How can you open the integrated terminal in Visual Studio Code?

Resposta

Through View → Terminal or with Ctrl+ backtick.

23Pergunta

How do you launch a Python file from the integrated terminal?

Resposta

By typing python filename or py filename.

24Pergunta

What is a Python library?

Resposta

A collection of ready-made code providing reusable functions or tools for a purpose.

25Pergunta

Which Python library is used for data manipulation?

Resposta

Pandas is used for data manipulation.

26Pergunta

Which Python library is used for numerical calculations?

Resposta

NumPy is used for numerical calculations.

27Pergunta

Which Python library is used for data visualization?

Resposta

Matplotlib is used for data visualization.

28Pergunta

Which Python library is used for machine learning?

Resposta

Scikit-learn is used for machine learning.

29Pergunta

Which Python library is used for web development?

Resposta

Django is used for web development.

30Pergunta

Name a Python library associated with deep learning.

Resposta

Keras is associated with deep learning.

31Pergunta

Name two other Python libraries linked to deep learning besides Keras.

Resposta

TensorFlow and PyTorch are linked to deep learning.

32Pergunta

How do you calculate the perimeter of a square with side length 5?

Resposta

Multiply 4 by 5 to get 20 units.

33Pergunta

What formula calculates the area of a square with side length 5?

Resposta

Square the side length: 5 squared equals 25 square units.

34Pergunta

How is the circumference of a circle with radius 5 calculated?

Resposta

Use 2π times 5 to find the circumference.

35Pergunta

What formula calculates the area of a circle with radius 5?

Resposta

Multiply π by 5 squared to get the area.

36Pergunta

How does the course demonstrate printing a patterned shape with asterisks?

Resposta

By placing asterisks and line breaks inside strings passed to print().

Teste-se com o quiz

Teste seu conhecimento com 13 perguntas sobre Python Basics and Math Functions.

1. What does Python display when it executes `print(2+5)`?

2. Which type of Python string can contain line breaks directly within its delimiters?

Faça o quiz →

Leia a ficha de revisão

Revise o curso completo na ficha de revisão para Python Basics and Math Functions.

Veja a ficha de revisão →

Similar courses

Crie seus próprios flashcards

Importe seu curso e a IA gera flashcards em 30 segundos.

Gerador de flashcards