Docsity

Class Notes on 26th of Python, Cheat Sheet of Computer Communication Systems

Toggle sidebar
bg1
Python Lines and indentation
Python programming if the code ends in
In windows terminal we use backslash whereas in linux and python it uses
forward slash.
Comment starts with # used to describe be commands
To disable lines of code.
Dark Strings – Any statements enclosed within three double or single quotes.
Used to tell the user how to use particular module.
Ends with .py file it is a collection of commands
H.W.
Write a module in python programming for adding and multiplying four different
numbers along with dark strings.
Finding the factorial of a number
Sum of n numbers
Explicit
Conversion python list to set
Set to tuple
List to tuple
Type conversion
text=” Hello world”
Print(len(text))
First_char=text[0]
Substring=text[7:12]
Substring=text[7:12:2]
Reverse_string=text[::-1]
Reverse_string12=text[::-13:-1]
Rev=text[:-13:-3]
pf2

Partial preview of the text

Download Class Notes on 26th of Python and more Cheat Sheet Computer Communication Systems in PDF only on Docsity!

Python Lines and indentation Python programming if the code ends in In windows terminal we use backslash whereas in linux and python it uses forward slash. Comment starts with # used to describe be commands To disable lines of code. Dark Strings – Any statements enclosed within three double or single quotes. Used to tell the user how to use particular module. Ends with .py file it is a collection of commands H.W. Write a module in python programming for adding and multiplying four different numbers along with dark strings. Finding the factorial of a number Sum of n numbers Explicit Conversion python list to set Set to tuple List to tuple Type conversion text=” Hello world” Print(len(text)) First_char=text[0] Substring=text[7:12] Substring=text[7:12:2] Reverse_string=text[::-1] Reverse_string12=text[::-13:-1] Rev=text[:-13:-3]

PPROCEDURE TO OPEN A FILE IN VISUAL STUDIO:

 Download the zip file and extract.

 Open visual studio code and open a new window.

 After opening the new window open the terminal and change the option to

command prompt.

 In the terminal run the command python –version to check whether the

python programming is working.

 Run the code python -m venv venv.

Data.head- shows first 5 rows

Data.sample- a random row

Data.share

Data.describe- tells you the statistical values

Data.columns_values

JSON – dictionary key -value pairs

API