Pytondan Anlayanalar Bi Yardım Edebilirmisiniz?
-
1-
Define an array in the beginning. Get inputs from user. Check if input is in the array or not.
Let's say array is [8, 5, 2, 6, 4, 10]
Enter a number to search: 7
7 is not in the list
Enter a number to search: 6
6 is in the list (Place = 3)
Enter a number to search: 8
4 is in the list (Place = 0)
2-
You will create a program that solves polynomials for you. Lets say you have a function like
this.
f(x) = a + b x + c x ^ 2 + d x ^ 3 + e x ^ 4 + ...
Define an array that contains a b c d e …. values in the beginning of your code. Input x from the
user. Calculate value of f(x) for that x and print it. You can use ** operator for getting power of one
variable to another one.
A = B**C means that calculate B to the power of C and assign it to A.
A = 2**4 In this case A is equal to 16
You can have more than 5 elements in array. Your program must still give correct results if you
change content or size it.
Examples
Lets say your function is
f(x) = -10 + 5x – 4x^2 + x^4
In this case your array will be
arr = [-10, 5, -4, 1]
for this array your function will run like this.
Enter x: 5
f(x) = 40 for x = 5
Enter x: -2
f(x) = -44 for x = -2
Enter x: 0
f(x) = -10 for x = 0
#####################
For f(x) = 1 – x^2
your array is [1, 0, -1]. Here are some inputs and outputs
Enter x: 10
f(x) = -99 for x = 10
Enter x: 1
f(x) = 0 for x = 1
3-
Define an array with even size in the beginning of your code. Print if array is symmetric or not.
[1, 0, 0, 1] is symmetric while
[5, 2, 1, 1, 3, 5] is not.
4- Define an array with odd size in the beginning of your code. Check if following condition
holds for that array.
A is an array with 2n+1 elements
a[0] > a[1] < a[2] > a[3] < …. a[2n-2] > a[2n-1] < a[2n]
If this condition satisfies for your array, print “Array is a zig-zag array” else print array is not a
zig-zag array.
For example
arr = [10, 4, 6, 2, 5]
is a zig-zag array. While
arr = [5, 3, 4 , 2, 10, 7, 4]
is not because 7 is not smaller than 6
Hint: every 2k
th element must be bigger than 2k+1th element and every 2k+1thelement must be
smaller than 2k+2
th
element for every k smaller than n
BONUS:
You have an array with n elements. Print the position of each element if array is sorted.
For example if array is [42, 16, 54, 52, 12, 88, 57, 21, 34]
42 is on 5th on the array
16 is on 2th on the array
54 is on 7th on the array
52 is on 6th on the array
12 is on 1th on the array
88 is on 9th on the array
57 is on 8th on the array
21 is on 3th on the array
34 is on 4th on the array
Hint: You don't need to sort array.
saat 12 ye yetiştirmem gerek ama bilmediğim şeylerde var içinde bu seferlik bi yardım edin diğerine söz çalışacam
-
ne yapmak istediğini sen biliyomusun hacı ?
edit:.bizden ne istediğini söylermisin hocam
-
k.bakma soruyu anlayamadım?
edit : pardon :D bunları pytonda algoritmalarını çıkarmam gerkiyodu 12 ye kadar ama zaman çok az kaldı o yüzden kendi yazdım yanlış olanları gönderecem artık
-
bunları buraya yazmış olmamın nedeni bu ödevi vermem gerekiyo ama yapamıyorum sorabileciğim etrafımda bilgisayar bilen kimse yok bende mecburen buraya yazdım