-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: #4c93cb
WSQ12 – Greatest Common Divisor
Comments Off on WSQ12 – Greatest Common Divisor
Posted in Blogs, Syndicated, TC1014 Blogs
Arrays/Vectores
“En programación, una matriz o vector (llamado en inglés array) es una zona de almacenamiento continuo, que contiene una serie de elementos del mismo tipo, los elementos de la matriz. Desde el punto de vista lógico una matriz se puede ver como un conjunto de elementos ordenados en fila (o filas y columnas si tuviera dos dimensiones).” Esta es una definicion de lo que serian vectores, aqui esta mi codigo para poder ver un ejemplo de esto….lo unico es que mi programa esta delimitado a solo poder aceptar 90 valores: https:/
#Tc1017#WSQ10 La informacion donde saque la definicion: http:/
Comments Off on Arrays/Vectores
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #0b0080, #252525, #494949, #4c93cb, #8cbf99, #TC1017, WSQ10
Calling Python functions
I made a simple Python program where i call a function i just created in that same Python program.
To call a function, first you have to create one(You can see how to here) then you give the values or ask the user to input value or values to the function to work, the next step is to create a new variable and asign it the function, now you are up to call the function using a print you can print the valiabre you assigned to the function, it will print the result of the function with the numbers you or the user gived.
If you don’t know how to create a Python function, you may want to go and check the post I made about it! Here’s the link: http:/
Comments Off on Calling Python functions
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #222222, #333333, #4c93cb, #8cbf99, #mastery11
Creation and use of ranges in Python
#Mastery25– Creation and use of ranges in Python #TC1014 @PablO_CVi
Loops can be created with while(You can see here how to make loops with while) and for making loops with ranges, the loop has to be with for, the next steps must be followed, first write for, then the variable this loop is applying like x, after this goes in range, and in parenthesis the number it will stop, and it will start from 0 (8), another option is to separate with a comma the number you want to start and the number you want it to stop, (0,-8), the last way of using the range is first the numer it is going to start, then separated with a comma the number it is going to end, and sepparated from another comma the number of numbers it will count per time. For example: for i in range (1,sz+1):).
Here is my code: https:/
Comments Off on Creation and use of ranges in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #222222, #4c93cb, #66757f, #8cbf99, #Mastery25, #TC1014
#Mastery07
Ok to make a comment on a python program you only need to put a hashtag (#) and then you write the comment you want to and when you finish your comment you only press enter and continue your code.
on this program you will see that I made a comment to put my name and my student ID: https:/
Featuring the Work
#Mastery04 – Submit work via Blog RSS and GitHub #TC101 @PablO_CVi
This is the use of while.
- BLOG RSS: http:/
/ digiart.withknown.com/ 2015/ whileloop - GitHub: https:/
/ github.com/ PablOCVi/ Mastery/ blob/ master/ Mastery19.py
Comments Off on Featuring the Work
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #222222, #4c93cb, #66757f, #8cbf99, #mastery04, #TC101
Pick a number
#333333; line-height: 1.5em !important;”>I learned how to use the while function in python thanks to this WSQ. Its easier to do a “while” than a lot of “ifs”, thats why i made my code with a single while function.
#333333; line-height: 1.5em !important;”>I used this links that showed me how to get a random number and how to use the while function in python.
#333333; line-height: 1.5em !important;”>#4c93cb; text-decoration: none;” href=”http://stackoverflow.com/questions/5555712/generate-a-random-number”>http:/
#333333; line-height: 1.5em !important;”>#4c93cb; text-decoration: none;” href=”http://www.tutorialspoint.com/python/python_loops.htm”>http:/
#333333; line-height: 1.5em !important;”>Here’s my code:
#333333; line-height: 1.5em !important;”>#8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/Gilberto” rel=”tag”>#Gilberto Rogel García a01630171
#333333; line-height: 1.5em !important;”>import random
#333333; line-height: 1.5em !important;”>value= random.randint(1,100)
#333333; line-height: 1.5em !important;”>tries=0
#333333; line-height: 1.5em !important;”>num= int(input(“Guess a number from 1 to 100:”))
#333333; line-height: 1.5em !important;”>while num != value: ###the while funtion starts here, i put “!=” so when the number is different from value the while function will take place.
#333333; line-height: 1.5em !important;”>if num>value :
#333333; line-height: 1.5em !important;”>print (num, “is too high”)
#333333; line-height: 1.5em !important;”>num= int(input(“Try again:”))
#333333; line-height: 1.5em !important;”>tries=tries+1
#333333; line-height: 1.5em !important;”>elif num<value :
#333333; line-height: 1.5em !important;”>print (num, “is too low”)
#333333; line-height: 1.5em !important;”>num= int(input(“Try again:”))
#333333; line-height: 1.5em !important;”>tries= tries+1
#333333; line-height: 1.5em !important;”>tries= tries +1 ###here is where the while function ends, when the number is equal to value.
#333333; line-height: 1.5em !important;”>print(“Congratulations!, The right number is”,value)
#333333; line-height: 1.5em !important;”>print(“It took you” ,tries, “tries to win”)
#333333; line-height: 1.5em !important;”>#8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/TC1014″ rel=”tag”>#TC1014 #8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/WSQ06″ rel=”tag”>#WSQ06
#TC1014 #WSQ06 PICK A NUMBER
#333333; line-height: 1.5em !important;”>I learned how to use the while function in python thanks to this WSQ. Its easier to do a “while” than a lot of “ifs”, thats why i made my code with a single while function.
#333333; line-height: 1.5em !important;”>I used this links that showed me how to get a random number and how to use the while function in python.
#333333; line-height: 1.5em !important;”>#4c93cb; text-decoration: none;” href=”http://stackoverflow.com/questions/5555712/generate-a-random-number”>http:/
#333333; line-height: 1.5em !important;”>#4c93cb; text-decoration: none;” href=”http://www.tutorialspoint.com/python/python_loops.htm”>http:/
#333333; line-height: 1.5em !important;”>Here’s my code:
#333333; line-height: 1.5em !important;”>#8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/Gilberto” rel=”tag”>#Gilberto Rogel García a01630171
#333333; line-height: 1.5em !important;”>import random
#333333; line-height: 1.5em !important;”>value= random.randint(1,100)
#333333; line-height: 1.5em !important;”>tries=0
#333333; line-height: 1.5em !important;”>num= int(input(“Guess a number from 1 to 100:”))
#333333; line-height: 1.5em !important;”>while num != value: ###the while funtion starts here, i put “!=” so when the number is different from value the while function will take place.
#333333; line-height: 1.5em !important;”>if num>value :
#333333; line-height: 1.5em !important;”>print (num, “is too high”)
#333333; line-height: 1.5em !important;”>num= int(input(“Try again:”))
#333333; line-height: 1.5em !important;”>tries=tries+1
#333333; line-height: 1.5em !important;”>elif num<value :
#333333; line-height: 1.5em !important;”>print (num, “is too low”)
#333333; line-height: 1.5em !important;”>num= int(input(“Try again:”))
#333333; line-height: 1.5em !important;”>tries= tries+1
#333333; line-height: 1.5em !important;”>tries= tries +1 ###here is where the while function ends, when the number is equal to value.
#333333; line-height: 1.5em !important;”>print(“Congratulations!, The right number is”,value)
#333333; line-height: 1.5em !important;”>print(“It took you” ,tries, “tries to win”)
#333333; line-height: 1.5em !important;”>#8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/TC1014″ rel=”tag”>#TC1014 #8cbf99; text-decoration: none; font-family: ‘Helvetica Neue’, Helvetica, Arial, sans-serif; padding: 3px; font-size: 1em; background-repeat: repeat-x;” href=”http://gilrg18.withknown.com/tag/WSQ06″ rel=”tag”>#WSQ06