Flashcard: Python Basics and Math Functions — 36 carte

Tutte le carte

1Domanda

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

Risposta

Text, numbers, and evaluated expressions.

2Domanda

Which quote styles can Python strings use?

Risposta

Single, double, or triple quotes.

3Domanda

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

Risposta

Span multiple lines.

4Domanda

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

Risposta

Inserts a line break.

5Domanda

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

Risposta

The string repeated four times.

6Domanda

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

Risposta

The absolute value of a number.

7Domanda

What does pow(a,b) calculate?

Risposta

The value of a raised to the power of b.

8Domanda

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

Risposta

Rounds the number to the nearest integer.

9Domanda

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

Risposta

Rounds the number to the given decimal places.

10Domanda

What does ceil() return for a number?

Risposta

The smallest integer greater than or equal to the number.

11Domanda

What does floor() return for a number?

Risposta

The largest integer less than or equal to the number.

12Domanda

What does the factorial function return for an integer n?

Risposta

The product of all positive integers from 1 to n.

13Domanda

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

Risposta

120

14Domanda

What does 'import math' do in Python?

Risposta

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

15Domanda

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

Risposta

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

16Domanda

What does 'import math as M' do?

Risposta

It assigns the alias M to the math module.

17Domanda

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

Risposta

By calling M.sqrt(25).

18Domanda

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

Risposta

It imports sqrt under the local alias jazr.

19Domanda

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

Risposta

By calling jazr(25), which returns 5.

20Domanda

How does a compiler process code compared to an interpreter?

Risposta

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

21Domanda

Which commands run Python files in Visual Studio Code?

Risposta

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

22Domanda

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

Risposta

Through View → Terminal or with Ctrl+ backtick.

23Domanda

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

Risposta

By typing python filename or py filename.

24Domanda

What is a Python library?

Risposta

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

25Domanda

Which Python library is used for data manipulation?

Risposta

Pandas is used for data manipulation.

26Domanda

Which Python library is used for numerical calculations?

Risposta

NumPy is used for numerical calculations.

27Domanda

Which Python library is used for data visualization?

Risposta

Matplotlib is used for data visualization.

28Domanda

Which Python library is used for machine learning?

Risposta

Scikit-learn is used for machine learning.

29Domanda

Which Python library is used for web development?

Risposta

Django is used for web development.

30Domanda

Name a Python library associated with deep learning.

Risposta

Keras is associated with deep learning.

31Domanda

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

Risposta

TensorFlow and PyTorch are linked to deep learning.

32Domanda

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

Risposta

Multiply 4 by 5 to get 20 units.

33Domanda

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

Risposta

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

34Domanda

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

Risposta

Use 2π times 5 to find the circumference.

35Domanda

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

Risposta

Multiply π by 5 squared to get the area.

36Domanda

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

Risposta

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

Metti alla prova te stesso con il quiz

Metti alla prova le tue conoscenze con 13 domande su 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?

Fai il quiz →

Leggi la scheda di revisione

Ripassa il corso completo nella scheda di revisione per Python Basics and Math Functions.

Vedi la scheda di revisione →

Similar courses

Crea le tue flashcard

Importa il tuo corso e l'AI genera flashcard in 30 secondi.

Generatore di flashcard