HITENDRA PATEL

VARIABLES IN PYTHON

Published 3 years ago 1645 Views
image

We all know, variables are storing values into our system.

Unlike other programming languages we can also declare variables in python.

But, for declare variable we don't need to add prefix ahead of variable like PHP, Ex. : $var = "variable"

In python simple name a variable and assign a value to it.

x = 2
y = 7

We can also declare string by single or double quotes :

x = 'i am hitendra'
y = "i am hitendra"

We also assign integer, decimal, boolean values in python :

x = 307
y = 30.7
z = True
a = False

Unlike other programming languages there are simple rules to declare a variable

  1. cannot start with a number
  2. must start with a letter or the underscore character
  3. only contain alpha numeric characters and underscores
  4. names are case-sensitive

A BLOG ABOUT DEVELOPMENT

Subscribe and get my latest blog post in your inbox.
image
DIGITAL OCEAN SETUP LARAVEL

Install & configure laravel project into live digital ocean server.

image
LARAVEL PUSH NOTIFICATION

Laravel push notification for devices with FCM

image
INSTALL COMPOSER ON MACOS

Install Composer on MacOS