Tech Getz

Main Menu

  • Mobile
  • Apple
  • Computer
  • Contact Us
Sign in / Join

Login

Welcome! Login in to your account
Lost your password?

Lost Password

Back to login

logo

  • Mobile
    • JIO starts 5G service in India next year:Mukesh Ambani

      12/08/2020
      0
    • Xiaomi Mi 10 pro launched with 5G

      03/29/2020
      0
    • Redmi Note 9 Pro launched Rs 14999

      03/12/2020
      0
    • RealMe 6 pro launch in India on March 5

      02/26/2020
      0
    • Vivo S1 Pro Review

      01/27/2020
      0
    • Why Android Studio for App development?

      01/23/2020
      0
    • samsung Galaxy A50 specification and review

      12/28/2019
      0
    • How to stop adding someone to Whatsapp Group

      12/24/2019
      0
    • Great Apps and Service 2019

      12/21/2019
      0
  • Apple
    • The story of Jobs and Ipod

      11/16/2020
      0
    • Jobs firing and return to Apple Inc

      10/09/2019
      0
    • Apple iPad 2018 Vs iPad 2017

      03/29/2018
      0
  • Computer
    • JIO starts 5G service in India next year:Mukesh Ambani

      12/08/2020
      0
    • How to enable WhatsApp 'Disappearing Messages' feature

      11/19/2020
      0
    • What is data Analyst and Scope?

      11/08/2020
      0
    • What is for Looping in C?

      09/29/2020
      0
    • Which is the first program language from Bill Gates

      09/20/2020
      0
    • Tiktok rival launched by Youtube

      09/16/2020
      0
    • Which is the first video Conferencing App In the World

      08/23/2020
      0
    • What are the Retan Tata's Investments in Startups

      08/13/2020
      0
    • What are Chinese Social Media Applications

      07/14/2020
      0
  • Contact Us
Computer
Home›Computer›How to start a Python programmer III

How to start a Python programmer III

By fazilmuhammed
02/23/2020
578
0
Share:

How to assign the values to variables on python?

Python variables are assign explicit declaration to reserve memory space. The declaration is happens automatically when you assign a value to a variable. The equal sign (=) is used to assign values to variables.The operand to the left side of the = operator is the name of the variable and the operand to the right side of the = operator is the value stored in the variable.

eg  counter = 100 for integer value assign

In multiple value assigns single value to several variables simultaneously for example a=b=c=1

Which are Standard data types?

In the data stored in the memory for programming data types is needed for example in case of age use Number, in the case of name use string. detailed data types are

  • Numbers
  • String
  • List
  • Tuple
  • Dictionary

Number

Number data types stores numeric values. Number objects are created when you assign a value to them.For example

Num = 1

Different types of data types are in python

  • int (signed integers)
  • long (long integers, they can also be represented in octal and hexadecimal)
  • float (floating point real values)
  • complex (complex numbers)
int long float complex
10 51924361L 0.0 3.14j
100 -0x19323L 15.20 45.j
-786 0122L -21.9 9.322e-36j
080 0xDEFABCECBDAECBFBAEl 32.3+e18 .876j
-0490 535633629843L -90. -.6545+0J
-0x260 -052318172735L -32.54e100 3e+26J
0x69 -4721885298529L 70.2-E12 4.53e-7j

source is www.tutorialspoint.com

String

String will represent the characters quotation marks

str = ‘Hello World!’
Python allows for either pairs of single or double quotes. Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 at the end.The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator.

Lists

Lists are similar to arrays in C.Lists is the versatile of Python’s compound data types. A list contains items separated by commas and enclosed within square brackets ([]). To some extent, One difference between them is that all the items belonging to a list can be of different data type.

The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1. The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. Example

list = [ 'xpdf', 123 , 1.12 'james', 80.2 ]

Tuples

A tuple is another data type it is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parentheses.

The main differences between lists and tuples are: Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed, while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. Example

tuple = ( 'xpdf', 123 , 1.12 'james', 80.2 )

Dictionary

Python’s dictionary is the kind of hash table type. They work like associative arrays or hashes found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.

Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]).Example

dict = {} dict[‘x’] = “This is x” dict[5] = “This is five”

What are Data Type Conversion of python

To convert between types, you simply use the type name as a function.There are several built  functions to perform conversion from one data type to another. The functions return a new object representing the converted value.

Sr.No. Function & Description
1 int(a[,base])

It converts a to an integer. base specifies the base if x is a string.

2 long(a [,base] )

It converts a to a long integer. base specifies the base if a is a string.

3 float(a)

It converts x to a floating-point number.

4 complex(real [,imag])

It creates a complex number.

5 str(a)

It converts object x to a string representation.

6 repr(a)

It converts object x to an expression string.

7 eval(str)

To evaluates a string and returns an object.

8 tuple(s)

It converts s to a tuple.

9 list(s)

It converts s to a list.

10 set(s)

It converts s to a set.

11 dict(d)

It creates a dictionary. d must be a sequence of (key,value) tuples.

12 frozenset(s)

It converts s to a frozen set.

13 chr(a)

It converts an integer to a character.

14 unichr(a)

It converts an integer to a Unicode character.

15 ord(a)

It converts a single character to its integer value.

16 hex(a)

It converts an integer to a hexadecimal string.

17 oct(a)

It converts an integer to an octal string.

 

 

 

Previous Article

Which are the top 10 Tech Companies ...

Next Article

Top 10 Indian Billionaires of India

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

Related articles More from author

  • Computer

    What is Bitcoin? Details, History

    12/24/2019
    By fazilmuhammed
  • Computer

    How to type symbols and emojis in windows using keyboard

    03/23/2020
    By fazilmuhammed
  • Computer

    What is SAP? Define SAP job scope

    01/13/2020
    By fazilmuhammed
  • Computer

    To checkwhether if Facebook shared your data with Cambridge Analytica

    04/10/2018
    By fazilmuhammed
  • Computer

    What is Recursion in C?

    04/29/2020
    By fazilmuhammed
  • Computer

    Let us Study C programming 1

    04/14/2020
    By fazilmuhammed

Leave a reply Cancel reply

  • Computer

    What is Netflix?

  • Business

    UC browser with share File Transfer App Launched for Android

  • Tech Getz

    Rare Stories About Dr. APJ Abdul Kalam

  • Recent

  • Popular

  • Comments

  • JIO starts 5G service in India next year:Mukesh Ambani

    By fazilmuhammed
    12/08/2020
  • How to enable WhatsApp ‘Disappearing Messages’ feature

    By fazilmuhammed
    11/19/2020
  • The story of Jobs and Ipod

    By fazilmuhammed
    11/16/2020
  • What is data Analyst and Scope?

    By fazilmuhammed
    11/08/2020
  • THE UNKNOWN FACTS ABOUT FLIPKART

    By fazilmuhammed
    10/31/2020
  • OPERATING SYSTEM USERS SHARE

    By fazilmuhammed
    07/23/2017
  • WHAT IS BELUGA CAVIAR

    By fazilmuhammed
    07/23/2017
  • BEST SELLING AUTOMOBILES

    By fazilmuhammed
    07/23/2017
  • Rare Stories About Dr. APJ Abdul Kalam

    By fazilmuhammed
    07/26/2017
  • Is it coffee help you live longer?

    By fazilmuhammed
    08/02/2017

Tech News

  • ComputerMobile

    JIO starts 5G service in India next year:Mukesh Ambani

    Jio 5G service will be launch may be in June 2021 said Mukesh Ambani during his keynote at India Mobile Congress 2020.Jio developing affordable android phone. The collaboration with Google ...
  • Computer

    How to enable WhatsApp ‘Disappearing Messages’ feature

    In the new updation of Whatsapp introduced new feature is disappearing message feature. This feature is once enabled, new messages sent in the individual or group chat will disappear after ...
  • Apple

    The story of Jobs and Ipod

    Ipod is the Apple’s one of the creative productive. In the 1990s walkman is the portable music player, but it is bulky. In the time Steve Jobs things 1000 music ...
  • Computer

    What is data Analyst and Scope?

    The data analyst can do the transforming data into information. This will improve knowledge and business. Now data analysis plays a role in making decisions more scientific and helping businesses ...
  • BusinessStartup

    THE UNKNOWN FACTS ABOUT FLIPKART

    1.Flipkart is an Singaporean e-commerce company but the headquartered Singapore (legal domicile) and Operation headquarter Bangalore, Karnataka, India. 2.The company started in the year  Sachin Bansal and Binny Bansal in 2007. 3.The first ...

About Us

Contact Us


  • +919995217791
  • techyget@gmail.com
  • Recent

  • Popular

  • Comments

  • JIO starts 5G service in India next year:Mukesh Ambani

    By fazilmuhammed
    12/08/2020
  • How to enable WhatsApp ‘Disappearing Messages’ feature

    By fazilmuhammed
    11/19/2020
  • The story of Jobs and Ipod

    By fazilmuhammed
    11/16/2020
  • What is data Analyst and Scope?

    By fazilmuhammed
    11/08/2020
  • OPERATING SYSTEM USERS SHARE

    By fazilmuhammed
    07/23/2017
  • WHAT IS BELUGA CAVIAR

    By fazilmuhammed
    07/23/2017
  • BEST SELLING AUTOMOBILES

    By fazilmuhammed
    07/23/2017
  • Rare Stories About Dr. APJ Abdul Kalam

    By fazilmuhammed
    07/26/2017

Follow us

© Copyright TECHGETZ. All rights reserved.