Karteikarten: Python Basics and Math Functions — 36 Karten

Alle Karten

1Frage

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

Antwort

Text, numbers, and evaluated expressions.

2Frage

Which quote styles can Python strings use?

Antwort

Single, double, or triple quotes.

3Frage

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

Antwort

Span multiple lines.

4Frage

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

Antwort

Inserts a line break.

5Frage

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

Antwort

The string repeated four times.

6Frage

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

Antwort

The absolute value of a number.

7Frage

What does pow(a,b) calculate?

Antwort

The value of a raised to the power of b.

8Frage

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

Antwort

Rounds the number to the nearest integer.

9Frage

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

Antwort

Rounds the number to the given decimal places.

10Frage

What does ceil() return for a number?

Antwort

The smallest integer greater than or equal to the number.

11Frage

What does floor() return for a number?

Antwort

The largest integer less than or equal to the number.

12Frage

What does the factorial function return for an integer n?

Antwort

The product of all positive integers from 1 to n.

13Frage

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

Antwort

120

14Frage

What does 'import math' do in Python?

Antwort

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

15Frage

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

Antwort

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

16Frage

What does 'import math as M' do?

Antwort

It assigns the alias M to the math module.

17Frage

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

Antwort

By calling M.sqrt(25).

18Frage

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

Antwort

It imports sqrt under the local alias jazr.

19Frage

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

Antwort

By calling jazr(25), which returns 5.

20Frage

How does a compiler process code compared to an interpreter?

Antwort

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

21Frage

Which commands run Python files in Visual Studio Code?

Antwort

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

22Frage

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

Antwort

Through View → Terminal or with Ctrl+ backtick.

23Frage

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

Antwort

By typing python filename or py filename.

24Frage

What is a Python library?

Antwort

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

25Frage

Which Python library is used for data manipulation?

Antwort

Pandas is used for data manipulation.

26Frage

Which Python library is used for numerical calculations?

Antwort

NumPy is used for numerical calculations.

27Frage

Which Python library is used for data visualization?

Antwort

Matplotlib is used for data visualization.

28Frage

Which Python library is used for machine learning?

Antwort

Scikit-learn is used for machine learning.

29Frage

Which Python library is used for web development?

Antwort

Django is used for web development.

30Frage

Name a Python library associated with deep learning.

Antwort

Keras is associated with deep learning.

31Frage

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

Antwort

TensorFlow and PyTorch are linked to deep learning.

32Frage

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

Antwort

Multiply 4 by 5 to get 20 units.

33Frage

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

Antwort

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

34Frage

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

Antwort

Use 2π times 5 to find the circumference.

35Frage

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

Antwort

Multiply π by 5 squared to get the area.

36Frage

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

Antwort

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

Teste dich mit dem Quiz

Teste dein Wissen mit 13 Fragen zu 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?

Quiz machen →

Lernzettel lesen

Überprüfe den vollständigen Kurs im Lernzettel zu Python Basics and Math Functions.

Lernzettel ansehen →

Similar courses

Erstelle deine eigenen Karteikarten

Importiere deinen Kurs und die KI erstellt in 30 Sekunden Karteikarten.

Karteikarten-Generator