Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Python variables declaration and naming conventions with rules with sample code using google colab. в хорошем качестве

Python variables declaration and naming conventions with rules with sample code using google colab. 4 года назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Python variables declaration and naming conventions with rules with sample code using google colab.

https://www.plus2net.com/python/varia... Like any other programming language we can create and use variables to store our data. There are some rules or conventions we have to follow while creating variables in Python. Name must start with lower or upper case char or with underscore (only ) . We can’t use number as first char of the variable. We can use number or underscore within the variable name. There is no length restriction Can assign different types to same variable Variables are case sensitive Reserved words can’t be used Must assign before using We can do operation with similar variables Scope is limited to page only , it is destroyed once the execution is over , we are discussing only normal variables not session variables Declaring variable a=45 my_name="Raju" _mark=65 Address="World" print ( Address,my_name,_mark,a ) We can’t use number as first char of the variable 4t=56 We can convert string to integer by using int() function , similarly we can convert one integer variable to string variable by using str() function. We will use this to convert the variables before adding them. a='45' # a is a string variable, it is not an integer b=42 #print(a+b) # error as we can't add one string with integer variable print(a+str(b)) # this is fine print(int(a)+b) # this is fine Usually life of a variable remain till the execution of the page is over.

Comments