Programmer's World
1 subscriber
2 photos
1 link
Download Telegram
Channel created
hello im Devprintx 😃.

I will start learning programming with you and share with you and help you learn with me step by step ❤️.

1-First we will start with Python 📱.

2-The second will be JavaScript 📱.


I will publish many codes and explanations in the coming days. Share the channel to spread the benefit 📱.

Enjoy watching 💙
Please open Telegram to view this post
VIEW IN TELEGRAM
1🔥1🥰1
The first thing is the print order.

Executed Code 📱 :

print("hello world")

Output:

hello world
Please open Telegram to view this post
VIEW IN TELEGRAM
Before all this, you will need a good code editor.

If you are on the phone : pydroid 3

If you are on the computer : Visual Studio Code
The second thing is the variables.

It represents the closet that keeps things inside it.

Executed Code 📱 :

a = "DevprintX"
print(a)

output :

DevprintX

Ofcourse you can't use any of python keywords as variable names or you will get syntax error like True = 'Yes' it will give you error but you can use yes = True.
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
You can also use it in a different way.

Executed Code 📱 :

first_name = "DevprintX"
second_name = "Dev"
print(first_name + second_name)

output :

DevprintXDev

To be more organized, clean something small.

first_name = "DevprintX"
second_name = "Dev"
print(first_name + " " +second_name)

output :

DevprintX Dev

This allows us to add space between words.
Please open Telegram to view this post
VIEW IN TELEGRAM
Also.

first_name = "DevprintX"
print(f"your name is : {first_name}")

output :

your name is DevprintX

f means format Its name in Python is : f-string


Another example 📱:

age = 18
print(f"you are {age} years old")

output :

you are 18 years old
Please open Telegram to view this post
VIEW IN TELEGRAM
Today's lesson is : Type casting = the process of converting a variatile from one data type to another
str(), int(), float(), bool()


Executed Code 📱 :

name = "DevprintX"
age = 18
price = 10.99
is_student = True

print(type(name))
print(type(age))
print(type(price))
print(type(is_student))

output :

<class 'str'>
<class 'int'>
<class 'float'>
<class 'bool'>

the explanation :

DevprintX is #string (DevprintX)
the nember 18 is
#integer (18)
the nember 10.99 is
#float (10.99)
True is
#boolean (True)
Please open Telegram to view this post
VIEW IN TELEGRAM
note :

If we put any number or anything literally between quotation marks " "

The type will be (str) #string


Executed Code 📱 :

age = "18"
print(type(age))

output :

<class 'str'>

We can also change the type of anything.


Executed Code 📱 :

As we know that 18 is integer
number1 = str(18)
number2 = float(18)
number3 = bool(18)

print(type(number1))
print(type(number2))
print(type(number3))

output :
<class 'str'>
<class 'float'>
<class 'bool'>

Although it is an integer, the output came out like this, so we can conclude that we can change the type of anything.
Please open Telegram to view this post
VIEW IN TELEGRAM
Now we will work with input : Allows us to enter the information ourselves.


Executed Code 📱 :

age = int(input("Enter your age : ")) 
print(f"your age is {age}")

The output will be the number you entered, For example, if we enter 18

your age is  : 18

note : We put int so that the program accepts only correct numbers. For example, if we enter an incorrect name or number, an error will appear.
Please open Telegram to view this post
VIEW IN TELEGRAM