0% found this document useful (0 votes)
4 views

Python is a High

Python is a high-level, interpreted, and open-source general-purpose programming language that supports multiple paradigms. Key features include dynamic typing, indentation-based block definition, and various debugging methods such as print statements, logging, and unit testing. Additionally, Python provides string manipulation capabilities, such as slicing and searching for substrings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Python is a High

Python is a high-level, interpreted, and open-source general-purpose programming language that supports multiple paradigms. Key features include dynamic typing, indentation-based block definition, and various debugging methods such as print statements, logging, and unit testing. Additionally, Python provides string manipulation capabilities, such as slicing and searching for substrings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

- Python is a High-Level Language

- Python is an interpreted language


- Python is a general purpose language
- Python is a Multi-Paradigm Language
- Python is an open source language
- For writ a comment in Python you have to add # in the beginning of the line
- Arithmetic operation in Python : + * - / % ** //(Division integer result)
-

- A variable in python can start with a letter or underscore and can contain letters , numbers,
and uderscores
- Python is dynamic type
- In Python A block is defined by consistent indentation.
- Debugging in Python :
o Using Print Statment
o Use pdp (pdp.set_trace() : pause execution and open interactive debugging prompt)
o Use logging
o Unit testing (unittest, pytest,nose)
o Profiling and Perfortmance Debugging (cProfile) : pyhton -m cProfile qsdq.py
o Using trace for code coverage : python -m trace –trace qsdq.py
o Using IDE Debugger
o Summary of Best Practices:
 For quick checks: Use print() or logging.
 For detailed, step-by-step debugging: Use pdb or an IDE debugger.
 For production code: Use logging instead of print statements.
 For testing functionality: Use unit tests with pytest or unittest.
 For performance issues: Use cProfile to identify bottlenecks.
- min(x,y,z) return the minimum value
- The function len can be used to find out the length of a string, among other things. The
function returns the number of characters in a string.
- odd numbers are integers that are not divisible by 2
- The continue command is use inside loop to skip the rest of the current iteration and move
directly to the next iteration of the loop
- Slicing is the process of selecting a substring from a string :
o String my_string = “EXEMPLARY"
o my_string[2:6] == “EMPL"
- The in operator can tell us if a string contains a particular substring.
- Python string method find tell us if a substring exists in a string and returns either the first
index where it is found, or -1 if the substring is not found within the string.
- Using global Keyword allows modification of global variables inside a function.

You might also like