How to Run Python in MS Visual Studio Code
In this video we will see how to run python programs in MS Visual Studio Code.
Please watch this video and let me know in the comments section if you have any questions.
Please do like, share and subscribe my youtube channel for more such videos.
float(): Converts a worth to a drifting point number.
str(): Converts a worth to a string.
bool(): Converts a worth to a boolean.
b = 3 + 4j
result = a + b
print(result)
Examples of explicit type casting:
Cheet Sheet: 👇
Type Casting
What is type casting?
Type casting, on a very basic level, is the method involved with changing the information kind of a variable.v Fuction used in type casting:
int(): Converts a worth to a whole number.float(): Converts a worth to a drifting point number.
str(): Converts a worth to a string.
bool(): Converts a worth to a boolean.
v Examples of implicit type casting:
program1:
a = 2.5b = 3 + 4j
result = a + b
print(result)
program2:
num = 10
message = "The value of num is: " + str(num)
print(message)
Examples of explicit type casting:
Program1:
num_float = 3.14
num_int = int(num_float)
print(num_int)
Program2:
num_int = 10
num_float = float(num_int)
print(num_float)
Program3:
num_int =
456
num_str =
str(num_int)
print(num_str)
Comments
Post a Comment
Please comment