Polina Horodyska
@pole55
The program finds the 10 most frequently occurring words in a text file with stopwords (most common words) excluded. The text we use here is "A Tale o
Python
Given a list of numbers with all elements sorted in ascending order, determine and print the number of distinct elements in it.
Example input: 1 2 2
Python
Given a list of non-zero integers, find and print the first adjacent pair of elements that have the same sign. If there is no such pair, print 0.
Exa
Python
Statement
"Fibonacci numbers are the numbers in the integer sequence starting with 1, 1 where every number after the first two is the sum of the two p
Python
jiuyuan3 try this:
prev, next = 1, 1
index = 2
possible_fib = int(input())
while possible_fib > next:
prev, next = next, prev + next
index += 1
if possible_fib == next:
print(index)
else:
print(-1)3 years ago
darwin1012 prev = 1
next = 1
index = 2
check_fib = int(input())
while check_fib > next:
new_next = prev + next
prev = next
next = new_next
index += 1
if check_fib == next:
print(index)
else:
print(-1)
it says to use a while loop3 years ago
Fibonacci numbers are the numbers in the integer sequence starting with 1, 1 where every number after the first two is the sum of the two preceding on
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Determine the length of the wide
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Find how many elements of this s
Python
Given a sequence of distinct non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the second larges
Python
A number is a disarium number only if the sum of its digits powered with their respective position is equal to the original number.
For example: 135
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the number of elements of
Python
TASK:
Write a program to check whether a given number is trimorphic or not?
In mathematics a trimorphic number is a number whose cube (expressed in a
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the number of even element
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the maximum of the sequenc
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the average of the sequenc
Python
Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the sum of the sequence.
Python
Given a sequence of non-negative integers, where each number is written in a separate line. Determine the length of the sequence. The sequence ends wi
Python
"As a future athlete you just started your practice for an upcoming event. On the first day you run x miles, and by the day of the event you must be a
Python
"For a given integer X, find the greatest integer n where 2ⁿ is less than or equal to X. Print the exponent value and the result of the expression 2ⁿ.
Python
"Given an integer not less than 2. Print its smallest integer divisor greater than 1."
Example input
15
Example output
3
Python