Python

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.

Share tech news, updates, or what's on your mind.

Sign up to Post

Python Programming: While and For Loops
Learn the basics of while and for loops in Python.

1. while loops are used for testing while, or until, a condition is met

2. The structure of a while loop is as follows: while <condition>: do something repeate

3. The break statement may be used to exit a while loop when a condition is met

4. for loops iterate through a sequence or range a specified amount

5. The structure of a for loop is as follows: for <every element> in a <a sequence or range>: do something

6. The continue statement may be used to exit an iteration of a for loop, but not the loop itself.

1
Want Experts Exchange at your fingertips?
LVL 9
Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Python Programming: If Statements
Learn the basics of if, else, and elif statements in Python 2.7.

1. Use "if" statements to test a specified condition.


The structure of an if statement is as follows:
if <condition>:         
           do something

Open in new window

2. Use "else" statements to allow the execution of an alternative, if the first condition is not met


The structure of an if, else statement is as follows:
if <condition>:
         do something     
else:
         do something different

Open in new window

3. Use "elif" statements allow for the checking of multiple conditions.


The structure of an if, else, elif statement is as follows:    
if <condition>:
         do something     
elif <another condition>:
         do something different     
else:
         do something completely different

Open in new window

6
Python Programming: Lists
Learn the basics of lists in Python.

1. Lists, as their name suggests, are a means for ordering and storing values.

2. Lists are declared using brackets; for example: t = [1, 2, 3]

3. Lists may contain a mix of data types; for example: t = ['string', 1, True]

4. Lists may be nested, for example: t = [ 'string', [1, True]]

5. List elements are accessed by index; for example: t[0]

6. The slice method is used to access a specific range of elements within a list; for example: t[1:3]

0
 

Expert Comment

by:Abdou DOUCOURE
Very simple and quick. Good micro tuto
0
Python Programming: Strings
Learn the basics of strings in Python: declaration, operations, indices, and slicing.

1. Strings are declared with quotations; for example: s = "string"

2. Strings are immutable.

3. Strings may be concatenated or multiplied using the addition and multiplication operators, respectively.

4. String characters may be accessed by index; for example: s[1]

5. A specific range of a string may be accessed using the slice method; for example: s[1:3]

1

Python

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.