P1.- #Jorge Fernando Saldaña Cabal #A01350730 import math def distance(x1,y1,x2,y2): z1=x1-x2 z1=z1**2 z2=y1-y2 z2=z2**2 res=math.sqrt(z1+z2) return(res) def main(): x1=int(input(‘Type x1: ‘)) y1=int(input(‘Type y1: ‘)) x2=int(input(‘Type x2: ‘)) y2=int(input(‘Type y2: ‘)) print(‘The distance between those points is: ‘, distance(x1,y1,x2,y2)) return(0) main()… Continue Reading →
P1.- #Jorge Fernando Saldaña Cabal #A01350730 import math def distance(x1,y1,x2,y2): z1=x1-x2 z1=z1**2 z2=y1-y2 z2=z2**2 res=math.sqrt(z1+z2) return(res) def main(): x1=int(input(‘Type x1: ‘)) y1=int(input(‘Type y1: ‘)) x2=int(input(‘Type x2: ‘)) y2=int(input(‘Type y2: ‘)) print(‘The distance between those points is: ‘, distance(x1,y1,x2,y2)) return(0) main()… Continue Reading →
P1.- #Fernando Saldaña #A01350730 def superpower (a,b): ans = 1 for i in range(b): ans = ans * a return (ans) print (“Hey lets make some math”) x = int(input(“Please type a non-negative number so we can raised it: “))… Continue Reading →
P1.- #Fernando Saldaña #A01350730 def superpower (a,b): ans = 1 for i in range(b): ans = ans * a return (ans) print (“Hey lets make some math”) x = int(input(“Please type a non-negative number so we can raised it: “))… Continue Reading →
A function is a group of instructions together that are all represented by a single name. To create a function we have to use the special word ‘def’ before we state our function. Followed by ‘def’ will be the name… Continue Reading →
Knowing about types of variables is very important in programming. You have to know how to differenciate between ‘3’ and 3, because if you mix types you have to be very careful or an error migh occur. A simple way… Continue Reading →
A function is a group of instructions together that are all represented by a single name. To create a function we have to use the special word ‘def’ before we state our function. Followed by ‘def’ will be the name… Continue Reading →
Nowadays internet is full of social networks. They are very useful if they are used for good purposes. In order to get the full beneficts of social media we must create accounts on each of the web pages we want… Continue Reading →
As I’ve posted before conditionals are very useful in python, it’s kind of the main idea of a computer to choose between do something or to don´t. So far we´ve seen If, Elif and else. But what happened when we… Continue Reading →
This task was about making a programm that asks the user for two integers. The user will read that the first number she/he types will be the begining of a serie of numbers and the second will be the end… Continue Reading →