Is their any functions in python to join a list of strings to a single string ?

we know that function has rich set of built in functions in python, so the answer is off course their is a functions in python to join a list of strings to a single string .as the name suggest join() is the function in python to join a list of strings to a single string.Let we check the syntax of join().

string.join(list)

where string is the separator string and list is a list of strings

Example of join function in python

item= [‘ Hello’, ‘good morning ‘]

string = ‘,’.join(item)

print(string)

any functions in python to join a list of strings to a single string

Modules and Packages in Python

Modules and Packages are the most important and widely used concept in python.Modules and Packages support reusability and easy coding for programmers.

What is a Modules in Python

A Modules is simply a single python file with extension .py. Modules contains global variables and group of functions .Modules is a single executable .py files.we can use functions and global variables in module in any python page by simply importing that module in that page.Here is the example usage of a Modules

Module calculator.py

def sum(a,b):
    sum = a + b 
    print("The sum is: ", sum)


Importing and calling that Module

import calculator

calculator.sum(3,4)

Modules and Packages in Python

What is a Packages in Python

Packages is a collections of modules, it simple a directory that contains lots of modules and a __init__.py file.The package may contains sub package .

employee(Package)
| __init__.py (Constructor)
| contact.py (Module)
| department.py (Module)
| salary.py (Module)

file_put_contents in php

file_put_contents is the built-in function in PHP, which is the most helpful functions to handle files in PHP.file_put_contents () function is used to write a string to a file.

Here is the syntax of file_put_contents in php

file_put_contents($FILE, $DATA)

$FILE: The file on which you want to write.
$DATA: The Content that has to be written on the specified file.

Return Value : it returns the number of bytes that were written on the specified file 

Here is the example of file_put_contents in php

echo file_put_contents("hello.txt", "file_put_contents PHP tutorials");

localhost/phpinfo.php

localhost/phpinfo.php is default PHP info path, phpinfo.php is actually a aa file most of the developer used to find out the complete information about the PHP like version what are the library enabled in PHP. Also it help you to find out the root path,Configuration apc, calendar info ,cgi-fcgi ,curl info, date lib info , PHP Variables etc

Here is the phpinfo.php file code

<?php

phpinfo();

?>

Demo localhost/phpinfo.php display

localhost/phpinfo.php