Python explain it briedfly computer science
Answers
Answered by
3
This video will expand on the basic concepts that we talked about in the previous video. In the first video, we talked about a terminology called assignment.
x = 5 is an assignment.
You assign values to variables. A variable can be assigned many times, and it always keeps the value of its most recent assignment.
If I do, x = 7, it replaces x = 5.
You can do x = x + 1, which adds 1 to its most recent assignment.
If we print(x), we would get 8 because 7 was its most recent assignment, and we add 1 to 7.
In the previous video, we also briefly talked about functions. We used the print() function and the type function().
A reminder of what functions are. Functions are fancy terms for defining commands that we can use in Python, and Python comes with a lot of preconfigured functions like print() and type().
When we use a specific function, it is called a function call.
When I write type(4), I am calling the function type with a value 4.
When calling a function, the value inside the parentheses is called an argument. 4 is an argument of the function.
All you need to know is that values inside the parentheses of functions are called arguments. That’s the name that they’re given.
When I print(type(4)), type(4) gives us the value, <type ‘int’>, which we print and display.
Whenever a function call gives us a value, we call it the return value.
Using the type function, we expect the function to give us back the type of the value, and if the function gives us anything back, that value given back is just called the return value.
We’ve talked a bit about types so far. Sometimes, you don’t have the type that you want.
For example, you could have a string like fruits = ” apples”
Before the word, apples, you want to put a number like 5 to get 5 apples.
We talked about how you could use the + operator to combine strings together.
However, you cannot combine an integer with a string because they’re not the same type.
Python has built-in functions that convert values from one type to another type.
x = 5 is an assignment.
You assign values to variables. A variable can be assigned many times, and it always keeps the value of its most recent assignment.
If I do, x = 7, it replaces x = 5.
You can do x = x + 1, which adds 1 to its most recent assignment.
If we print(x), we would get 8 because 7 was its most recent assignment, and we add 1 to 7.
In the previous video, we also briefly talked about functions. We used the print() function and the type function().
A reminder of what functions are. Functions are fancy terms for defining commands that we can use in Python, and Python comes with a lot of preconfigured functions like print() and type().
When we use a specific function, it is called a function call.
When I write type(4), I am calling the function type with a value 4.
When calling a function, the value inside the parentheses is called an argument. 4 is an argument of the function.
All you need to know is that values inside the parentheses of functions are called arguments. That’s the name that they’re given.
When I print(type(4)), type(4) gives us the value, <type ‘int’>, which we print and display.
Whenever a function call gives us a value, we call it the return value.
Using the type function, we expect the function to give us back the type of the value, and if the function gives us anything back, that value given back is just called the return value.
We’ve talked a bit about types so far. Sometimes, you don’t have the type that you want.
For example, you could have a string like fruits = ” apples”
Before the word, apples, you want to put a number like 5 to get 5 apples.
We talked about how you could use the + operator to combine strings together.
However, you cannot combine an integer with a string because they’re not the same type.
Python has built-in functions that convert values from one type to another type.
Answered by
1
Answer:
Data science can be defined as a blend of mathematics, business acumen, tools, algorithms and machine learning techniques, all of which help us in finding out the hidden insights or patterns from raw data which can be of major use in the formation of big business decisions
Explanation:
Similar questions