How Long Does It Take to Learn Python

pawandeep
Updated on 11-Mar-2021 09:07:26

315 Views

How fast can someone learn or excel in something completely depends on one’s interest in learning, dedication and persistence.Now, how long does it take to learn Python depends on how much do you want to learn.The basics of Python which include functions, loops, conditional statements, datatypes, etc., would take about one to two weeks on average for a newbie. Again, this depends on how much time do you devote and your persistence in learning.If you aspire to learn Python in detail, it would take few months to learn Python. There is no end to learning Python as it is too ... Read More

Is Python a Scripting Language?

pawandeep
Updated on 11-Mar-2021 09:06:44

5K+ Views

Yes, Python is a scripting language.Scripting language v/s Programming languageThe first question which strikes into the mind is, what is the difference between programming and scripting language. The only difference which exists is that the scripting language does not require any compilation, it is directly interpreted.For example, the programs written in a language such as C++ are compiled before execution whereas the programs written in scripting languages such as Python or JavaScript are directly interpreted and are not compiled.Why is Python a scripting language?A scripting language is one that is interpreted. Python is an interpreted language. Python uses an interpreter ... Read More

Declare a Global Variable in Python

pawandeep
Updated on 11-Mar-2021 09:06:20

4K+ Views

What is a global variable?A global variable is a variable that is declared outside the function but we need to use it inside the function.Example Live Demodef func():    print(a) a=10 func()Output10Here, variable a is global. As it is declared outside the function and can be used inside the function as well. Hence the scope of variable a is global.We will see what happens if we create a variable of same name as global variable inside the function.In the above example, the variable a is declared outside the function and hence is global.If we declare another variable with same name inside ... Read More

Kth Column Product in Tuple List in Python

AmitDiwan
Updated on 11-Mar-2021 09:05:42

234 Views

When it is required to find the 'K'th column product in a list of tuple, a simple list comprehension and a loop can be used.A tuple is an immutable data type. It means, values once defined can't be changed by accessing their index elements. If we try to change the elements, it results in an error. They are important contains since they ensure read-only access. A list can be used to store heterogeneous values (i.e data of any data type like integer, floating point, strings, and so on).A list of tuple basically contains tuples enclosed in a list.The list comprehension ... Read More

Remove Nested Records from Tuple in Python

AmitDiwan
Updated on 11-Mar-2021 09:05:14

363 Views

When it is required to remove nested record/tuples from a tuple of tuple, a simple loop and the 'isinstance' method and the enumerate method can be used.The enumerate method adds a counter to the given iterable, and returns it. The 'isinstance' method checks to see if a given parameter belong to a specific data type or not.Below is a demonstration of the same −ExampleLive Demotuple_1 = (11, 23, (41, 25, 22), 19) print("The tuple is : ") print(tuple_1) my_result = tuple() for count, elem in enumerate(tuple_1):    if not isinstance(elem, tuple):       my_result = my_result + ... Read More

Importance of C Language and Its General Structure

Bhanu Priya
Updated on 11-Mar-2021 08:36:53

7K+ Views

C programming is a general-purpose, procedural, imperative computer programming language.Importance of C LanguageC is called as a robust language, which has so many built-in functions and operations, which can be used to write any complex program.Generally, we use to call C as a middle level language. Because, the ‘C’ compiler combines the capabilities of an assembly language with the features of a high-level language. Therefore, it is best for writing both system software and business packages.‘C’ Programs are efficient and fast.C is highly portable, that is, ‘C’ programs written on one computer can be run on another with little (or) ... Read More

Format of C Language

Bhanu Priya
Updated on 11-Mar-2021 08:35:46

2K+ Views

C programming is a general-purpose, procedural, imperative computer programming language. In C language, we see thatStatements are terminated with semicolons.C is case sensitiveIndentation is ignored by the compiler.Strings are placed in double quotes.Library functions are lowercase.Newlines are handled via Format of CThe format of C programming language is explained below −SemicolonsSemicolons are very important in C.It tells the compiler, where one statement ends and the next statement begins.If we fail to place the semicolon after each statement, you will get compilation errors.Case SensitivityC is a case sensitive language. Although, int compiles, "Int”, "INT” or any other variation will not be ... Read More

Check If Value Is Palindrome Using C Language

Bhanu Priya
Updated on 11-Mar-2021 08:28:05

593 Views

A palindrome is nothing but any word, number, sentence, or other sequence of characters that reads the same backward as forward.In this programming, we are trying to enter a number from console, and assign that number to temp variable.If number is greater than zero, apply the logic given below −while(n>0){    r=n%10;    sum=(sum*10)+r;    n=n/10; }If temp=sum, then the given number is a palindrome. Otherwise, it is not a palindrome.ExampleFollowing is the C program for verification of a value being palindrome −#include #include void main(){    int n, r, sum=0, temp;    printf("Enter a number: ");    scanf("%d", &n); ... Read More

Include Header File Twice in a C Program

Bhanu Priya
Updated on 11-Mar-2021 08:16:08

1K+ Views

C header files include some predefined functions. For example, printf() and scanf() functions are defined in the stdio.h header file.Each header files in C contains different predefined functions to make programs simple to understand.When a header file is included two times in a C program, the second one gets ignored. In actual, the #, called the include, preceding a header file ensures that it is included only once during the compilation process.Example 1Following is the C program for computing an average of three numbers − Live Demo#include #include //header file included twice ,ignored by compiler main(){    int a, b, c, ... Read More

Different Searching Techniques in C Language

Bhanu Priya
Updated on 11-Mar-2021 07:59:07

10K+ Views

Searching technique refers to finding a key element among the list of elements.If the given element is present in the list, then the searching process is said to be successful.If the given element is not present in the list, then the searching process is said to be unsuccessful.C language provides two types of searching techniques. They are as follows −Linear searchBinary searchLinear SearchSearching for the key element is done in a linear fashion.It is the simplest searching technique.It does not expect the list to be sorted.Limitation − It consumes more time and reduce the power of system.Input (i/p)Unsorted list of ... Read More

Advertisements