Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a9b5b0

Browse filesBrowse files
committed
Update README.md
1 parent 886c146 commit 4a9b5b0
Copy full SHA for 4a9b5b0

File tree

1 file changed

+50
-55
lines changed
Filter options

1 file changed

+50
-55
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+50-55Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,7 @@ b.sayhello()
27382738
```
27392739
Hello, I’m B
27402740

2741-
Q.26. What is JSON? Describe in brief how you’d convert JSON data into Python data?
2741+
#### Q. What is JSON? Describe in brief how you’d convert JSON data into Python data?
27422742

27432743
Ans. JSON stands for JavaScript Object Notation. It is a highly popular data format, and it stores data into NoSQL databases. JSON is generally built on the following two structures:
27442744

@@ -2747,27 +2747,7 @@ Ans. JSON stands for JavaScript Object Notation. It is a highly popular data for
27472747

27482748
Python supports JSON parsers. In fact, JSON-based data is internally represented as a dictionary in Python. To convert JSON data into Python data, we use the load() function from the JSON module.
27492749

2750-
- How can you implement functional programming and why would you?
2751-
- Explain ctypes and why you would use them?
2752-
- What is multiple inheritence and when should you use it?
2753-
- What is a meta class?
2754-
- What are properties and what's the point?
2755-
- What's the difference between 2.7+ and 3?
2756-
- What is a unicode string?
2757-
- What does the yield statement do?
2758-
- What is a generator?
2759-
- Why would I use one?
2760-
- What is polymorphism, when would I use it?
2761-
- How do you go about packaging python code?
2762-
- Is Python compiled?, If yes how so, if not how so.
2763-
- What does __some-variable__ mean?
2764-
- Should I import an entire module?
2765-
- What does dynamicly/duck typed mean?
2766-
- When would I not use Python?
2767-
- What is DRY, how can I apply it through OOP or FP?
2768-
- When would I use Python?
2769-
2770-
1. What are the differences between Python and Java ?
2750+
#### Q. What are the differences between Python and Java ?
27712751

27722752
Python Vs Java
27732753
Comparison Python Java
@@ -2882,14 +2862,14 @@ Global, Local, Module and Class namespaces.
28822862
Triple quotes ‘’”” or ‘“ are string delimiters that can span multiple lines in Python. Triple quotes are usually used when spanning multiple lines, or enclosing a string that has a mix of single and double quotes contained therein.
28832863

28842864

2885-
Q34. How to use GUI that comes with Python to test your code?
2865+
#### Q. How to use GUI that comes with Python to test your code?
28862866

28872867
That is just an editor and a graphical version of the interactive shell. You write or load code and run it, or type it into the shell.
28882868
There is no automated testing.
28892869

28902870

28912871

2892-
Q36. How does the Python version numbering scheme work?
2872+
#### Q. How does the Python version numbering scheme work?
28932873

28942874
Python versions are numbered A.B.C or A.B.
28952875

@@ -2918,7 +2898,7 @@ In other words, all versions labeled 2.0aN precede the versions labeled 2.0bN, w
29182898

29192899
You may also find version numbers with a “+” suffix, e.g. “2.2+”. These are unreleased versions, built directly from the subversion trunk. In practice, after a final minor release is made, the subversion trunk is incremented to the next minor version, which becomes the “a0” version, e.g. “2.4a0”.
29202900

2921-
Q37. Where is math.py (socket.py, regex.py, etc.) source file?
2901+
#### Q. Where is math.py (socket.py, regex.py, etc.) source file?
29222902

29232903
If you can’t find a source file for a module, it may be a built-in or dynamically loaded module implemented in C, C++ or other compiled language. In this case you may not have the source file or it may be something like mathmodule.c, somewhere in a C source directory (not on the Python Path). There are (at least) three kinds of modules in Python:
29242904

@@ -2927,7 +2907,7 @@ If you can’t find a source file for a module, it may be a built-in or dynamica
29272907
- Modules written in C and linked with the interpreter; to get a list of these, type;
29282908
Import sys print sys.builtin_module_names;
29292909

2930-
Q38. How do I make a Python script executable on UNIX?
2910+
#### Q. How do I make a Python script executable on UNIX?
29312911

29322912
You need to do two things:
29332913
The script file’s mode must be executable and the first line must begin with “#!” followed by the path of the Python interpreter.
@@ -2952,7 +2932,7 @@ exec python $0 ${1+”$@”}
29522932
The minor disadvantage is that this defines the script’s `__doc__`string. However, you can fix that by adding:
29532933
`__doc__ = “””…Whatever…”””`
29542934

2955-
Q39. Why don’t my signal handlers work?
2935+
#### Q. Why don’t my signal handlers work?
29562936

29572937
The most common problem is that the signal handler is declared with the wrong argument list. It is called as:
29582938
handler (signum, frame)
@@ -2968,7 +2948,7 @@ Recompile Python
29682948
Re-link it using g++ (change LINKCC in the python Modules Makefile)
29692949
Link your extension module using g++ (e.g., “g++ -shared -o mymodule.so mymodule.o”).
29702950

2971-
Q42. How do I send mail from a Python script?
2951+
#### Q. How do I send mail from a Python script?
29722952

29732953
Use the standard library module smtplib. Here’s a very simple interactive mail sender that uses it. This method will work on any host that supports an SMTP listener.
29742954
```py
@@ -3004,7 +2984,7 @@ sts = p.close()
30042984
if sts != 0:
30052985
print (“Sendmail exit status”, sts)
30062986
```
3007-
Q43. How can I mimic CGI form submission (METHOD=POST)? I would like to retrieve web pages that are the result of posting a form. Is there existing code that would let me do this easily?
2987+
#### Q. How can I mimic CGI form submission (METHOD=POST)? I would like to retrieve web pages that are the result of posting a form. Is there existing code that would let me do this easily?
30082988

30092989
Yes. Here’s a simple example that uses httplib:
30102990
```py
@@ -3037,7 +3017,7 @@ print(x)
30373017
query_string
30383018
‘name=Guy%20Steele,%20Jr.’
30393019
```
3040-
Q44. Why is that none of my threads are not running? How can I make it work?
3020+
#### Q. Why is that none of my threads are not running? How can I make it work?
30413021

30423022
As soon as the main thread exits, all threads are killed. Your main thread is running too quickly, giving the threads no time to do any work.
30433023
A simple fix is to add a sleep to the end of the program that’s long enough for all the threads to finish:
@@ -3048,7 +3028,7 @@ for i in range(n): print name, i
30483028
for i in range(10)
30493029
```
30503030

3051-
Q45. Installation of Python 3.6.1
3031+
#### Q. Installation of Python 3.6.1
30523032

30533033
Download the required 3.6.1 python, executable installer file from the www.python.org.com website.
30543034
>
@@ -3077,7 +3057,7 @@ To set Path:
30773057
Now path setting is secured.
30783058

30793059

3080-
Q46. What Are The Implementation In Python Program?
3060+
#### Q. What Are The Implementation In Python Program?
30813061

30823062
Python program can be implemented by two ways
30833063
>
@@ -3157,7 +3137,7 @@ D:/mindmajix Python>python Demo.py
31573137
`-1000`
31583138
`2000.000`
31593139

3160-
Q47. What are The Data Types Supports in Python Language?
3140+
#### Q. What are The Data Types Supports in Python Language?
31613141

31623142
- Numbers- Numbers use to hold numerical values.
31633143

@@ -3395,8 +3375,6 @@ Constructor
33953375

33963376
The concept of binding or grouping related data members along with its related functionalities is known as a Encapsulation.
33973377

3398-
3399-
34003378
#### Q. Executing DML Commands Through Python Programs?
34013379

34023380
DML (Data Modification Language) Commands are used to modify the data of the database objects
@@ -3456,7 +3434,7 @@ For loop takes the given object, convert that object in the form of iterable obj
34563434
While getting the one by value element from the iterable object if stop iteration exception is raised then for loop internally handle that exception
34573435

34583436

3459-
Q68. OS Module
3437+
#### Q. OS Module
34603438

34613439
OS Module is a predefined module and which provides various functions and methods to perform the operating system related activities, such as creating the files, removing the files, creating the directories removing the directories, executing the operating system related commands, etc.
34623440
Example:
@@ -3471,8 +3449,6 @@ print(“3”,os.getcwd())
34713449
```
34723450
Output:
34733451

3474-
3475-
34763452
#### Q. What Are Applications of Python?
34773453

34783454
Applications of Python
@@ -3504,20 +3480,20 @@ PyChecker is a static analysis tool that detects the bugs in Python source code
35043480

35053481

35063482

3507-
- What is pass in Python?
3483+
#### Q. What is pass in Python?
35083484

35093485
Pass means, no-operation Python statement, or in other words it is a place holder in compound statement, where there should be a blank left and nothing has to be written there.
35103486

3511-
- In Python what are iterators?
3487+
#### Q. In Python what are iterators?
35123488

35133489
In Python, iterators are used to iterate a group of elements, containers like list.
35143490

35153491

3516-
- In Python what is slicing?
3492+
#### Q. In Python what is slicing?
35173493

35183494
A mechanism to select a range of items from sequence types like list, tuple, strings etc. is known as slicing.
35193495

3520-
- What are generators in Python?
3496+
#### Q. What are generators in Python?
35213497

35223498
The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.
35233499
Python generator produces a sequence of values to iterate on. This way, it is kind of an iterable. We define a function that ‘yields’ values one by one, and then use a for loop to iterate on it.
@@ -3586,44 +3562,44 @@ And now, when we call it again, it raises a StopIteration exception. This is bec
35863562
- Iterators are more memory-efficient.
35873563

35883564

3589-
- How can you copy an object in Python?
3565+
#### Q. How can you copy an object in Python?
35903566

35913567
To copy an object in Python, you can try copy.copy () or copy.deepcopy() for the general case. You cannot copy all objects but most of them.
35923568

35933569

35943570

3595-
- How you can convert a number to a string?
3571+
#### Q. How you can convert a number to a string?
35963572

35973573
In order to convert a number into a string, use the inbuilt function str(). If you want a octal or hexadecimal representation, use the inbuilt function oct() or hex().
35983574

3599-
- What is module and package in Python?
3575+
#### Q. What is module and package in Python?
36003576

36013577
In Python, module is the way to structure program. Each Python program file is a module, which imports other modules like objects and attributes.
36023578

36033579
The folder of Python program is a package of modules. A package can have modules or subfolders.
36043580

3605-
- Mention what are the rules for local and global variables in Python?
3581+
#### Q. Mention what are the rules for local and global variables in Python?
36063582

36073583
Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to be local.
36083584

36093585
Global variables: Those variables that are only referenced inside a function are implicitly global.
36103586

3611-
- How can you share global variables across modules?
3587+
#### Q. How can you share global variables across modules?
36123588

36133589
To share global variables across modules within a single program, create a special module. Import the config module in all modules of your application. The module will be available as a global variable across modules.
36143590

3615-
- Explain how can you make a Python Script executable on Unix?
3591+
#### Q. Explain how can you make a Python Script executable on Unix?
36163592

36173593
To make a Python Script executable on Unix, you need to do two things,
36183594

36193595
Script file's mode must be executable and
36203596
the first line must begin with # ( #!/usr/local/bin/python)
36213597

3622-
- Explain how to delete a file in Python?
3598+
#### Q. Explain how to delete a file in Python?
36233599

36243600
By using a command os.remove (filename) or os.unlink(filename)
36253601

3626-
- Explain how can you generate random numbers in Python?
3602+
#### Q. Explain how can you generate random numbers in Python?
36273603

36283604
To generate random numbers in Python, you need to import command as
36293605
```py
@@ -3639,22 +3615,22 @@ You can access a module written in Python from C by following method,
36393615

36403616
Module = =PyImport_ImportModule("<modulename>");
36413617

3642-
- Mention the use of // operator in Python?
3618+
#### Q. Mention the use of // operator in Python?
36433619

36443620
It is a Floor Divisionoperator , which is used for dividing two operands with the result as quotient showing only digits before the decimal point. For instance, 10//5 = 2 and 10.0//5.0 = 2.0.
36453621

3646-
- Mention five benefits of using Python?
3622+
#### Q. Mention five benefits of using Python?
36473623
- Python comprises of a huge standard library for most Internet platforms like Email, HTML, etc.
36483624
- Python does not require explicit memory management as the interpreter itself allocates the memory to new variables and free them automatically
36493625
- Provide easy readability due to use of square brackets
36503626
- Easy-to-learn for beginners
36513627
- Having the built-in data types saves programming time and effort from declaring variables
36523628

3653-
- Mention the use of the split function in Python?
3629+
#### Q. Mention the use of the split function in Python?
36543630

36553631
The use of the split function in Python is that it breaks a string into shorter strings using the defined separator. It gives a list of all words present in the string.
36563632

3657-
- Mention what is the difference between Django, Pyramid, and Flask?
3633+
#### Q. Mention what is the difference between Django, Pyramid, and Flask?
36583634

36593635
Flask is a "microframework" primarily build for a small application with simpler requirements. In flask, you have to use external libraries. Flask is ready to use.
36603636

@@ -3666,7 +3642,7 @@ Like Pyramid, Django can also used for larger applications. It includes an ORM.
36663642

36673643
The data in the failed server won't get removed, but there is a provision for auto-failure, which you can configure for multiple nodes. Fail-over can be triggered during any kind of socket or Memcached server level errors and not during normal client errors like adding an existing key, etc.
36683644

3669-
- Explain how you can minimize the Memcached server outages in your Python Development?
3645+
#### Q. Explain how you can minimize the Memcached server outages in your Python Development?
36703646

36713647
- When one instance fails, several of them goes down, this will put larger load on the database server when lost data is reloaded as client make a request. To avoid this, if your code has been written to minimize cache stampedes then it will leave a minimal impact
36723648
- Another way is to bring up an instance of Memcached on a new machine using the lost machines IP address
@@ -4644,3 +4620,22 @@ Without the rstrip(), we would get blank lines between the output.
46444620
#### Q. What are iterators and generators?
46454621
#### Q. What is Method Resolution Order ?
46464622
#### Q. Differentiate between append() and extend() methods ?
4623+
#### Q. How can you implement functional programming and why would you?
4624+
#### Q. Explain ctypes and why you would use them?
4625+
#### Q. What is multiple inheritence and when should you use it?
4626+
#### Q. What is a meta class?
4627+
#### Q. What are properties and what's the point?
4628+
#### Q. What's the difference between 2.7+ and 3?
4629+
#### Q. What is a unicode string?
4630+
#### Q. What does the yield statement do?
4631+
#### Q. What is a generator?
4632+
#### Q. Why would I use one?
4633+
#### Q. What is polymorphism, when would I use it?
4634+
#### Q. How do you go about packaging python code?
4635+
#### Q. Is Python compiled?, If yes how so, if not how so.
4636+
#### Q. What does __some-variable__ mean?
4637+
#### Q. Should I import an entire module?
4638+
#### Q. What does dynamicly/duck typed mean?
4639+
#### Q. When would I not use Python?
4640+
#### Q. What is DRY, how can I apply it through OOP or FP?
4641+
#### Q. When would I use Python?

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.