Posts

Python Strings

What are Strings? The following example shows a string contained within 2 quotation marks: # Use quotation marks for defining string "Michael Jackson" We can also use single quotation marks: # Use single quotation marks for defining string 'Michael Jackson' A string can be a combination of spaces and digits: # Digitals and spaces in string '1 2 3 4 5 6 ' A string can also be a combination of special characters : # Special characters in string '@#2_#]&*^%$' We can print our string using the print statement: # Print the string print ( "hello!" )

Python Data-Types

Types of objects in Python Python is an object-oriented language. There are many different types of objects in Python. Let's start with the most common object types:  strings ,  integers  and  floats . Anytime you write words (text) in Python, you're using  character strings  (strings for short). The most common numbers, on the other hand, are  integers  (e.g. -1, 0, 100) and  floats , which represent real numbers (e.g. 3.14, -42.0). # Integer 11 # Float 2.14 # String "Hello, Python 101! You can get Python to tell you the type of an expression by using the built-in  type()  function. You'll notice that Python refers to integers as  int , floats as  float , and character strings as  str . # Type of 12 type ( 12 ) # Type of 2.14 type ( 2.14 ) # Type of "Hello, Python 101!" type ( "Hello, Python 101!" )

Python Basics

Say "Hello" to the world in Python # Try your first Python output print('Hello, Python!') After executing the cell above, you should see that Python prints  Hello, Python! . Congratulations on running your first Python code! What version of Python are we using? There are two popular versions of the Python programming language i n use today: Python 2 and Python 3. The Python community has decided to move on from Python 2 to Python 3, and many popular libraries have announced that they will no longer support Python 2. Since Python 3 is the future, in this course we will be using it exclusively. How do we know that our notebook is executed by a Python 3 runtime? We can look in the top-right hand corner of this notebook and see "Python 3". We can also ask directly Python and obtain a detailed answer. Try executing the following code: import sys print ( sys . version ) 3.6.7 | packaged by conda-forge | (default, Nov 6 2019, 16:19:42) [GCC 7.3.0] Writing comment...

Lab - Manual

SPPU CN-Practicals (TE-Comp)   LIST OF LAB EXPERIMENTS Lab Expt. No. Problem Statement A1. Part A: Setup a wired LAN using Layer 2 Switch and then IP switch of minimum four computers. It includes preparation of cable, testing of cable using line tester, configuration   machine using IP addresses, testing using PING utility and demonstrate the PING packets   captured traces using Wireshark Packet Analyzer Tool. Part B: Extend the same Assignment for Wireless using Access Point A2. Write a program in C/C++   for error detection and correction for 7/8 bits ASCII codes using Hamming   Codes or CRC. Demonstrate the packets captured traces using Wireshark Packet Analyzer   Tool for peer to peer mode. ( 50% students will perform Hamming Code and others will   perform CRC) A3. Write a program   in Java/Python to demonstrate sub netting and find the sub net masks. A4. Installing and configure DHCP server a...