Instalar Bash de Ubuntu en Windows 10

--Originally published at Newbie Programmer

Hola, bienvenidos a este blog , en esta ocasión  se mostrara como instalar el Bash de Ubuntu en Windows 10. Es muy fácil su instalación y lleva a lo máximo 30 minutos.

Primero se necesita la Anniversary Update de Windows 10, la cual es la versión 1607. Esto se checa si en configuración nos vamos a Sistema> Acerca de. Importante: solo versiones de 64 bits.

captura-de-pantalla-3captura-de-pantalla-2

Después de comprobar si se tiene la versión correcta, proseguimos a volver a Configuración, solo que ahora nos vamos a la sección de Actualización y Seguridad, y en las opciones buscamos Para Programadores, en esas opciones  activamos el modo programador y esperamos a que Windows active ese modo.

captura-de-pantalla-4captura-de-pantalla-5

Después, abrimos el panel de control y nos vamos a la sección de Programas. en Programas le damos clic a Activar o desactivar las características de Windows. Después se abrirá una ventana en la cual buscaremos una Característica que se llame Subsistema de Windows para Linux (beta).

captura-de-pantalla-6captura-de-pantalla-7

Después de que le demos aceptar pasaran un corto lapso de tiempo, después aparecerá una ventana en la cual tendremos que reiniciar el equipo. Cuando el equipo se este reiniciando se visualizara una pantalla de Preparando Windows, como si hubiéramos actualizado el SO.Este proceso tardara algunos minutos.Captura de pantalla (8).png

Después de que se haya reiniciado el equipo, buscamos Bash, lo corremos y nos abrirá una ventana como si fuera el CMD de Windows. Lo único que debemos hacer a continuación es colocar y, esperar a que el proceso de instalación finalice y entonces nos pedirá el nombre del Usuario y una contraseña.

captura-de-pantalla-9

ximg_570998bb8323b.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.l29bWUELIg.png

Después de realizar este proceso, lo único que falta es abrir el Bash, buscamos de nuevo Bash y ahora se abrirá una ventana como esta. La cual es la terminal y se puede utilizar

captura-de-pantalla-11
Continue reading "Instalar Bash de Ubuntu en Windows 10"

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

 

 


Lists

--Originally published at Newbie Programmer

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

--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.

 

 

 


My new calculator

--Originally published at Newbie Programmer

giphy

Using python 3 as a calculator

I can use python 3 as a calculator using the interpreter of python, you can do the basic math functions.

numbers

The  integer numbers ( 23 , 45, 4) have type int , and the others numbers with a fractional part ( 2.5 , 4.34, 3.141592653….) have type float

The division (/) always returns a float number, to do a division to get a type int number you need to put // instead of / , and to calculate the remainder use the %.

paiton

In python is possible to use the ** operator to calculate powers, 2**2  is equal to write 2² (At a real calculator).

paitontri

You can use the equal sign = to assign a value to a variable, if you dont assing a variable, you cant use, and you accredit an error.

error65663545

In the interactive mode the last printed expression is assigned to the variable

taxes

And, you can round the number if you put the function round(AValuue,Numberofdecimals)

And now, a gif of a taco.

tacos

 


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.