{"id":7726,"date":"2021-07-04T18:27:20","date_gmt":"2021-07-04T12:57:20","guid":{"rendered":"https:\/\/python-programs.com\/?p=7726"},"modified":"2021-11-22T18:40:22","modified_gmt":"2021-11-22T13:10:22","slug":"python-data-presistence-variables","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-data-presistence-variables\/","title":{"rendered":"Python Data Presistence – Variables"},"content":{"rendered":"

Python Data Presistence – Variables<\/h2>\n

When you use an object of any of the above types – of any type for that matter – (as a matter of fact everything in Python is an object!) it is stored in the computer\u2019s memory. Any random location is allotted to it. Its location can be obtained by the built-in id ( ) function.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
>>> id(10)
\n1812229424
\n>>> id(‘Hello’)
\n2097577807520
\n>>> id([10,20,30])
\n2097577803464<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

However, order to refer to the same object repetitively with its id() is difficult. If a suitable name (by following rules of forming identifier) is given to an object, it becomes convenient while referring to it as and when needed. To bind the object with a name, the \u2018=\u2019 symbol is used. It is called the assignment operator.<\/p>\n

Here, an int object 5 is assigned a name \u2018radius\u2019. The id( ) of both is same.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
>>> id(5)
\n1812229264
\n>>> radius=5
\n>>> id(radius)
\n1812229264<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

The name ‘radius’ can now be used in different expressions instead of its id ( ) value.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
>>> diameter=radius*2
\n>>> diameter
\n10
\n>>> area=3. 142*radius*radius
\n>>> area
\n78.55
\n>>> circumference=2*3.142*radius
\n>>> circumference
\n31.419999999999998<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Dynamic Typing<\/strong><\/p>\n

Python is a dynamically typed language. This feature distinguishes it from C Family languages like C, C++, Java, and so on. These languages are statically typed. What is the difference?<\/p>\n

The difference is the manner in which a variable behaves. In statically typed languages, the variable is in fact a named location in the memory. Moreover, it is configured to store data of a certain type before assigning it any value. Data of any other type is not acceptable to the respective language compiler. Type of Variable is announced first, and data of only that type is acceptable. This makes these languages statically typed.<\/p>\n

Look at the following statements in a Java program. A string variable is declared and assigned a string value. However, if we try storing the value of any other type then the Java compiler reports an error.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
String somevar;
\nsomevar=”some string value”;
\nsomevar=999;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Java Compiler error<\/strong><\/p>\n\n\n\n
Error: incompatible types: int cannot be converted to java. lang.String<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

On the other hand, a variable in Python is not bound permanently to a specific data type. In fact, it is only a label to an object in memory. Hence, Java-like prior declaration of variable\u2019s data type is not possible, nor is it required. In Python, the data assigned to a variable decides its data type and not the other way round.<\/p>\n

Let us define a variable and check its id ( )<\/strong> as well as type ( )<\/strong>.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
>>> somevar=’some string value’
\n>>> id(somevar)
\n2166930029568
\n> > > type(somevar)
\n<class ‘str’><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u2018somevar\u2019 is a string variable here. But it\u2019s just a label. So you can put the same label on some other object.<\/p>\n

Let us assign an integer to Somevar’ and check id () as well as type () again.<\/p>\n

Example<\/strong><\/p>\n\n\n\n
>>> somevar=999
\n>>> id(somevar)
\n2166929456976
\n>>> type(somevar)
\n<class 1int’><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Two things to note here:<\/p>\n

    \n
  1. You didn\u2019t need a prior declaration of variable and its type.<\/li>\n
  2. Variable\u2019s type changed according to data assigned to it. That\u2019s why Python is called a dynamically typed language.<\/li>\n<\/ol>\n

    Sequence Operators<\/strong><\/p>\n

    As described earlier, string, list, and tuple objects are sequence types. Obviously, arithmetic operators won\u2019t work with them. However, the symbols \u2018+\u2019 and can. In this context, they are defined as concatenation and repetition operators respectively.
    \nThe concatenation operator (\u2018+\u2019) appends the contents of the second operand to the first. Of course, both operands must be of the same type.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> #concatenation of strings
    \n>>> str1=’Hello World.’
    \n>>> str2=’Hello Python.’
    \n> > > str1+str2
    \n‘Hello World.Hello Python.’
    \n> > > #concatenation of lists
    \n. . .
    \n>>> list1= [1,2,3,4]
    \n> > > list2= [‘one’, ‘two’, ‘three’ ,’four’ ]
    \n> > > listl+list2
    \n[1, 2 , 3 , 4 , ‘ one ‘ , ” two ‘ , ‘ three ‘ , ‘ four’]
    \n>>> ttconcatenation of tuples
    \n. . .
    \n>>> tup1=(1,2,3,4)
    \n>>> tup2=(‘one’,’two’,’three’, ‘four’)
    \n>>> tupl+tup2
    \n(1, 2 , 3, 4, ‘one’, ‘two’, ‘three’, ‘ four’)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Repetition operator(‘*’) concatenates multiple copies of a sequence. The sequence to be replicated is the first operand, the second operand is an integer that specifies the number of copies.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> #repetition operator with string
    \n. . .
    \n>>> strl=’Hello.’
    \n>>> str1*3
    \n‘Hello.Hello.Hello.’
    \n>>> #repetition operator with list
    \n. . .
    \n>>> list1= [1,2,3,4]
    \n>>> list1*3
    \n[1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
    \n>>> #repetition operator with tuple
    \ntup1=(1,2,3,4)
    \n>>> tup1*3
    \n(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Index operator (\u2018[]!) extracts an item at a given position in a sequence. As you know, the sequence is an ordered collection of items and each item has a positional index starting from 0. The expression seq[i] fetches ill item from a given sequence.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> #indexing of string
    \n. . .
    \n>>> str1=’Monty Python and the Holy Grail ‘
    \n>>> str1 [21]
    \n‘ H ‘
    \n>>> #indexing of list
    \n. . .
    \n>>> list1=[l,2,3,4,5,6,7,8,9,10]
    \n>>> list1 [6]
    \n7
    \n>>> list1= [‘Python ‘ , ‘\u2018Java’, ‘C++’, ‘Ruby’, ‘Kotlin’]
    \n>>> .list1 [3]
    \n‘Ruby’
    \n>>> #indexing of tuple
    \n. . .
    \n>>> tup1=(-50, 3.142, 2+3j, True, 50
    \n>>> tup1[2]
    \n(2+3j) )<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Slice operator (\u2018[:]\u2019) fetches a part of the sequence object. The expression has two integers on either side of the symbol inside square brackets. The first integer is an index of the first item in the sequence and the second integer is an index of the next item up to which slice is desired. For example seqflj] returns items from i* position to (j-l)the position. The first integer is 0 by default. Second integer defaults to the last index of the sequence. Remember index starts from 0.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> #slicing of string
    \n… strl=’Monty Python and the Holy Grail’
    \n>>> strl [13:16]
    \n‘and’
    \n>>> listl=[‘Python’, ‘Java’, ‘C++’, ‘Ruby’, ‘Kotlin’]
    \n>>> listl [1:3]
    \n[‘Java’, ‘C++’]
    \n>>> tupl=(-50, 3.142, 2 + 3j, True, 50)
    \n>>> tupl[2:4]
    \n( (2 + 3j), True)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    There are two \u2018Membership\u2019 operators in Python. The in operator checks if an operand exists as one of the items in a given sequence and returns True if so, otherwise, it returns False. The not-in operator does the opposite. It returns False if the operand doesn\u2019t belong to a given sequence, otherwise it returns True.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> #membership operator with string
    \n. . .
    \n>>> str1=’Monty Python and the Holy Grail’
    \n>>> ‘Holy’ in str1
    \nTrue
    \n>>> ‘Grill’ not in str1
    \nTrue
    \n>>> #membership operator with list
    \n. . .
    \n>>> list1=[‘Python’, ‘Java’, ‘C++’, ‘Ruby’, ‘Kotlin’]
    \n>>> ‘C#’ in list1
    \nFalse
    \n>>> ‘Ruby’ not in list1
    \nFalse
    \n>>> #membership operator with tuple
    \n. . .
    \n>>> tup1=(-50, 3.142, 2+3j, True, 50)
    \n>>> 3.142 in tup1
    \nTrue
    \n>>> 3.142 not in tup1
    \nFalse<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Mutability<\/strong><\/p>\n

    As already mentioned, everything in Python is an object. A Python object is either mutable or immutable. What is the difference?
    \nTo put it simply, the object whose contents can be changed in place is mutable. As a result, changes are not possible in the contents of immutable objects. Of the built-in objects numbers, string, and tuple objects are immutable. On the other hand, list and dictionary objects are mutable.<\/p>\n

    Let us try to understand the concept of mutability with the help of the id() function that we have earlier used. First, define a variable and assign an integer to it.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> x=100
    \n>>> id(x)
    \n1780447344<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Remember that a variable is just a label of the object in memory. The object is stored in a location whose id() is given as shown in example 1.31 above. (The location is allotted randomly. So, when you try it on your machine, it may be different.) To understand what goes on inside the memory, have a look at the diagram (figure 1.4) below. Figure 1.4 (a) shows a label assigned to an integer object 100.
    \nNext, assign x to another variable y.<\/p>\n

    \"Python<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> y=x
    \n>>> id(y)
    \n1780447344
    \n>>> y
    \n100<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Figure 1.4 (b) shows that id() of y is the same as id ( ) of x. It means both x and y are labels of the same object in memory, in this case, the number 100.
    \nNow, increment x by 1 (x=x+l). A new integer object 101 is located at a different location and it is bound to name x. Now x label is detached from 100 but y still remains on 100. (refer figure 1.4 (c))<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> x=x+1
    \n>>> X
    \n101
    \n>>> id(x)
    \n1780447376
    \n>>> id(y)
    \n1780447344<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    id (x) has changed but id (y) remains as earlier.<\/p>\n

    It is clear that the location containing object 100 doesn\u2019t get replaced by 101, instead, it is stored in a new location. Hence, we say that a Number object is immutable. String and tuple objects are also immutable. If we try to change the sequence of characters in a string or any of the items in a tuple, the TypeError message appears effectively meaning that items in a string\/tuple sequence can\u2019t be altered because they are immutable.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> str1=’Hello World’
    \n>>> str1[6]
    \n‘ W’
    \n>>> str1 [6] = ‘ z ‘
    \nTraceback (most recent call last):
    \nFile “<stdin>”, line 1, in <module>
    \nTypeError: ‘str’ object does not support item
    \nassignment
    \n>>> tup1=(-50, 3.142, 2+3j, True, 50)
    \n>>> tup1[1]
    \n3.142
    \n>>> tup1[1]=2.303
    \nTraceback (most recent call last):
    \nFile “<stdin>”, line 1, in <module>
    \nTypeError: ‘tuple’ object does not support item assignment<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    This restriction doesn\u2019t apply to list or dictionary objects. You can add, remove, or modify a list or dictionary. Hence, they are mutable.
    \nFollowing code demonstrates how an item in list\/dictionary is modified.<\/p>\n

    Example<\/strong><\/p>\n\n\n\n
    >>> list1=[‘python’, ‘java’,’C++’ , ‘Ruby’, ‘kotlin’]
    \n>>> list[2] = ‘c#’
    \n>>> list1
    \n[‘Python’ , ‘Java’ , ‘C#’ , ‘Ruby’ , ‘ Kotlin’ ]
    \n>>> dict1= {“Mumbai’ , : ‘Maharastra’ , ‘Hyderebad’ : ‘Telangana’ , ‘patna’ , : ‘Bihar’}
    \n>>>dict1 [‘Hyderabad’ ] = ‘Andhra pradesh’
    \n>>>dict1
    \n{‘Mumbai’ : ‘ Maharastra’ , ‘Hyderabad’ : ‘Andhra pradesh’ ‘patna’ : ‘Bihar’ }<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

    Addition\/removal of items in list and dictionary is being explained later in this chapter. That brings us to one of the questions left unanswered earlier. What is the difference between list and tuple? Now the answer is clear. Tuple is immutable. List is mutable.<\/p>\n","protected":false},"excerpt":{"rendered":"

    Python Data Presistence – Variables When you use an object of any of the above types – of any type for that matter – (as a matter of fact everything in Python is an object!) it is stored in the computer\u2019s memory. Any random location is allotted to it. Its location can be obtained by …<\/p>\n

    Python Data Presistence – Variables<\/span> Read More »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nPython Data Presistence - Variables - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/python-data-presistence-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Data Presistence - Variables - Python Programs\" \/>\n<meta property=\"og:description\" content=\"Python Data Presistence – Variables When you use an object of any of the above types – of any type for that matter – (as a matter of fact everything in Python is an object!) it is stored in the computer\u2019s memory. Any random location is allotted to it. Its location can be obtained by … Python Data Presistence – Variables Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/python-data-presistence-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-04T12:57:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-22T13:10:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png\",\"width\":508,\"height\":137,\"caption\":\"Python Data Presistence - Variables chapter 1 img 1\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage\",\"url\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/\",\"name\":\"Python Data Presistence - Variables - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage\"},\"datePublished\":\"2021-07-04T12:57:20+00:00\",\"dateModified\":\"2021-11-22T13:10:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/python-data-presistence-variables\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Data Presistence – Variables\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\"},\"headline\":\"Python Data Presistence – Variables\",\"datePublished\":\"2021-07-04T12:57:20+00:00\",\"dateModified\":\"2021-11-22T13:10:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage\"},\"wordCount\":1802,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/python-data-presistence-variables\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/python-programs.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Data Presistence - Variables - Python Programs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/python-programs.com\/python-data-presistence-variables\/","og_locale":"en_US","og_type":"article","og_title":"Python Data Presistence - Variables - Python Programs","og_description":"Python Data Presistence – Variables When you use an object of any of the above types – of any type for that matter – (as a matter of fact everything in Python is an object!) it is stored in the computer\u2019s memory. Any random location is allotted to it. Its location can be obtained by … Python Data Presistence – Variables Read More »","og_url":"https:\/\/python-programs.com\/python-data-presistence-variables\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2021-07-04T12:57:20+00:00","article_modified_time":"2021-11-22T13:10:22+00:00","og_image":[{"url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png"}],"twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Prasanna","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png","width":508,"height":137,"caption":"Python Data Presistence - Variables chapter 1 img 1"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage","url":"https:\/\/python-programs.com\/python-data-presistence-variables\/","name":"Python Data Presistence - Variables - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage"},"datePublished":"2021-07-04T12:57:20+00:00","dateModified":"2021-11-22T13:10:22+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/python-data-presistence-variables\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Python Data Presistence – Variables"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb"},"headline":"Python Data Presistence – Variables","datePublished":"2021-07-04T12:57:20+00:00","dateModified":"2021-11-22T13:10:22+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#webpage"},"wordCount":1802,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"image":{"@id":"https:\/\/python-programs.com\/python-data-presistence-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Data-Presistence-Variables-chapter-1-img-1.png","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/python-data-presistence-variables\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb","name":"Prasanna","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/python-programs.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7726"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=7726"}],"version-history":[{"count":3,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7726\/revisions"}],"predecessor-version":[{"id":7745,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7726\/revisions\/7745"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=7726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=7726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=7726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}