If

First declare variables
if1if2

This cant be printed, because the if only executes the action when its true.

And now, a if that can be printed because its true.

if3if4

You can add variables, more conditions.

if5if6

Source: https://www.youtube.com/watch?v=4u2ClNCtcgY&list=PLQVvvaa0QuDe8XSftW-RAxdo6OmaeL85M&index=8

 

More loops, loops everywhere, FOR LOOP.

giphy
Me when i see a loop

Welcome to another post, and another loop.

In this case we explain the FOR loop. The for loop is used for the same things as the While Loop, but the for loop is for finite loops.

You can use Lists.

untitleduntitled2

If you put, for example the print («A value») into the loop, the words «A value» can be printed with every number.

f3f4

Range function.

f5f6

If you put a third number in the (), this number activates a function that says steps of 2 in the range.

f7f8

And you can use slices (strings) for the for loops.

f9f10

Source: https://www.youtube.com/watch?v=xtXexPSfcZg&list=PLQVvvaa0QuDe8XSftW-RAxdo6OmaeL85M&index=7

 

 

Lists

ingredients-list-icon-icon-search-engine-10In this blog we introduce to create lists on python 3.

With a list you can use to group values.The list can be written as a list of comma-separated values (items) between square brackets.

l1l2

Indexing.

l3l4

Adding items.

l5l6

Changing the value of a character from the list.

l7l8

Append function, add items at the end of the list.

l9l10

Using slices to change values.

l11l12

Len function, counts how many items are in the list.

l13l14

Source: https://docs.python.org/3/tutorial/introduction.html

 

 

 

 

 

Strings

giphy
Welcome to a new post

In this post we have an introduction to strings of python 3.

First, the strings can be enclosed in single quotes (‘ ‘) or doble quotes (» «).

strings1strings2

You can put \ to scape single quote or put instead double qoutes » «

doesnt

The print () function

print.gif

printprint2

\n Character

nn2

If you dont like to expect a new line, you can put letter r before the quotes.

r1r2

Operator \t

If you want to span in multiple lines , you can put triple quotes( ¨¨¨     ¨¨¨)

triple1triple2

Properties of the strings.

p1p1-1

Indexed

i1i1-1

Slicing

s0-1s1

Strings learned.

before

And its the end.

 

 

 

Use Python in Command Prompt and open python files

Hello, this is a post to how to run Python in Command Prompt Windows 10, but before you need to have installed Python.

First you need to open the Command Prompt:Captura de pantalla (10)

Second: You need to know where is your python.exe

In my case i have mi python folder in the desktop and if you open the python.exe you can see where is python.exe.python.jpg

In this case python.exe is in C:\Users\angel\Desktop\Python\python.exe.

And this is How i run python in CMD

Captura de pantalla (11)

And now; How to run python files in CMD.

In the same screen of the CMD you can put exit() to close python, and now you write python and the name of the .py file Like This

arch

NOTE: PUT YOUR PYTHON .PY FILES IN YOUR PYTHON FOLDER.

archives

And this i how i run this files on CMD in Windows 10,i dont know if this metod is effective but works for me, remember im a Newbie and new doing blogs.

mindblowing.gif

A random gif.