More loops, loops everywhere, FOR LOOP.

--Originally published at Newbie Programmer

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

 

 


Strings

--Originally published at Newbie Programmer

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

t1 t2

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

--Originally published at Newbie Programmer

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.