What does the print() function display in Python output?
Text, numbers, and evaluated expressions.
Which quote styles can Python strings use?
Single, double, or triple quotes.
What can triple-quoted strings do that single or double quotes cannot?
Span multiple lines.
What does the escape sequence \n do inside a string?
Inserts a line break.
What is the result of the expression "python"*4?
The string repeated four times.
What does the built-in function abs() return?
The absolute value of a number.
What does pow(a,b) calculate?
The value of a raised to the power of b.
What does round(number,digits) do when digits is omitted?
Rounds the number to the nearest integer.
What does round(number,digits) do when digits is specified?
Rounds the number to the given decimal places.
What does ceil() return for a number?
The smallest integer greater than or equal to the number.
What does floor() return for a number?
The largest integer less than or equal to the number.
What does the factorial function return for an integer n?
The product of all positive integers from 1 to n.
What is the value of 5! (factorial of 5)?
120
What does 'import math' do in Python?
It loads the math module for use with the math. prefix.
How does 'from math import factorial, pi, log2' affect name usage?
It allows using factorial, pi, and log2 without the math. prefix.
What does 'import math as M' do?
It assigns the alias M to the math module.
How do you call square root using the alias M after 'import math as M'?
By calling M.sqrt(25).
What does 'from math import sqrt as jazr' do?
It imports sqrt under the local alias jazr.
How do you compute the square root of 25 using the alias jazr?
By calling jazr(25), which returns 5.
How does a compiler process code compared to an interpreter?
A compiler processes the whole program before execution, an interpreter processes line by line.
Which commands run Python files in Visual Studio Code?
Run Python File and Run Without Debugging (Ctrl+F5) run Python files.
How can you open the integrated terminal in Visual Studio Code?
Through View → Terminal or with Ctrl+ backtick.
How do you launch a Python file from the integrated terminal?
By typing python filename or py filename.
What is a Python library?
A collection of ready-made code providing reusable functions or tools for a purpose.
Which Python library is used for data manipulation?
Pandas is used for data manipulation.
Which Python library is used for numerical calculations?
NumPy is used for numerical calculations.
Which Python library is used for data visualization?
Matplotlib is used for data visualization.
Which Python library is used for machine learning?
Scikit-learn is used for machine learning.
Which Python library is used for web development?
Django is used for web development.
Name a Python library associated with deep learning.
Keras is associated with deep learning.
Name two other Python libraries linked to deep learning besides Keras.
TensorFlow and PyTorch are linked to deep learning.
How do you calculate the perimeter of a square with side length 5?
Multiply 4 by 5 to get 20 units.
What formula calculates the area of a square with side length 5?
Square the side length: 5 squared equals 25 square units.
How is the circumference of a circle with radius 5 calculated?
Use 2π times 5 to find the circumference.
What formula calculates the area of a circle with radius 5?
Multiply π by 5 squared to get the area.
How does the course demonstrate printing a patterned shape with asterisks?
By placing asterisks and line breaks inside strings passed to print().
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?
Überprüfe den vollständigen Kurs im Lernzettel zu Python Basics and Math Functions.
Lernzettel ansehen →Importiere deinen Kurs und die KI erstellt in 30 Sekunden Karteikarten.
Karteikarten-Generator