https://github.com/estebanpinal/WSQ/blob/master/quiz7
#QUIZ7https://github.com/ricardonewton/TC101/blob/master/fibonaccihttps://github.com/ricardonewton/TC101/blob/master/palindrome
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 →
In this Quiz we had to do two tasks. In the first one we had to create a program which calculates the Fibbonaci number of a value that we give to the computer. So the codes for the first task… Continue Reading →
In this Quiz we had to do two tasks. In the first one we had to create a program which calculates the Fibbonaci number of a value that we give to the computer. So the codes for the first task… Continue Reading →
Here is my code for quiz #7 in github. It took me a while but it works.
Fibonacci: https://github.com/VanessaBaeza17/Quiz7/blob/master/Fibonacci
Palindrome: https://github.com/VanessaBaeza17/Quiz7/blob/master/Palindrome
Thanks!
#Quiz07 #Quiz7 #SoMuchFun #Tc1017
The exercise was so easy, but i have a problem with the exercise number 1. I write a double (( and the terminal says that have a syntax error and I don’t see the double (( and then we I saw it, I delate one and then the program works well. Here is the code…
The exercise was so easy, but i have a problem with the exercise number 1. I write a double (( and the terminal says that have a syntax error and I don’t see the double (( and then we I saw it, I delate one and then the program works well. Here is the code…
This quiz was a little bit more of a challenge since it involved using iterations and strings to output a number in a sucession and determine if an input was a palindrome or wasn’t. It was difficult to find the pattern in the fibonacci series but i discovered that the values were passed to be sum again and again. First, there were standard results such as the first 2 numbers of the series so I did them with ifs to return the value required. For other values, I worked with 3 variables which changed values between them, and after the number was met the Sum would return from the function, thus giving the expected value.
Here’s the code:
https://github.com/CarlosGallegosT/Codes007/blob/master/Fibonacci
The question regarding palindromes was a little bit more complicated than the previous one. During the test, I managed to create a function to reverse the string by using the input lenght. What I couldn’t do was to correctly compare the values found in the strings. I guessed I did something wrong with the return or with any of the functions since it only returned one statement. Finally, I tried again and it worked as expected. Here’s the code:
https://github.com/CarlosGallegosT/Codes007/blob/master/Palindrome
Thanks for watching!