Python input() Function

Working with Python input() Function The Python input() function is used to take input from standard input devices. With the help of this function, you can ask user to provide values to a program at run time. When a Python program is running and a input function is called. The program execution will wait until the user send a input and press return key. Syntax input(prompt) Example: Below sample Python program will print a message on screen. Then input() will ask your to enter your name.

Another example of…

Read More

Bash – Functions

Functions in Bash A function which can also be referred to as subroutine or procedure is a block of code used for specific tasks. The function also has a property called re-usability. Bash script also provides functions. Syntax: funcationName(){ // scope of function } functionName //calling of function #1. Bash – Create Function Example Create your first function in shell script showing output “Hello World!”. Create a shell script “script.sh” using following code. #!/bin/bash funHello(){ echo “Hello World!”; } # Call funHello from anywhere in the script like below funHello…

Read More