Fetch substring from the given string and display the sub-string starting and ending position. Also, print the substring and its length
Runtime Input :
programming
program
Output :
0 6
Length is 7
Ques- create a SQL query .....on
Table : STUDENT
Admno 101 , 102 , 103 , 104 & 105
Name
Ayushi
heena
Jitender
meena
Marks
52, 95 , 89 , 65 ,98
1) Write a create table query
2) To displey al details of all students.
3) To dsplay al details in descending order of marks.
4) To display admno and name of all students whose name starts with 'A.
4 To display the maximum and minimum marks from the table students
5) To display al details of students whose marks are between 80 to 95 inclusive
def total_number_sequence(m, n):
if m < n:
return 0
if n == 0:
return 1
res = (total_number_sequence(m - 1, n) +
total_number_sequence(m // 2, n - 1))
return res
if __name__ == '__main__':
m = 10
n = 100
print('Total number of possible sequences:', total_number_sequence(m, n))
PROBLEM: 3N+1 sequence: determine which value(s) of N generate the longest sequence for the famous 3N+1 sequence. Refer to 8.5 in your runestone text for more details. Output the value(s) of N that generate the longest sequence.
C version: use 100 as the value of N
Consider the following to help you better understand how to solve this problem.
OUTPUT FORMAT:
C version - a single number
What is wrong with my code?
write a python programs that accepts three inputs x,y,z print true if x*y>z otherwise false
A new feature is to be implemented in Kindle. FEATURE : The user inputs the no. of days in which he would like to complete a particular book and the Kindle will create a reading plan for the user.
Write an algorithm which will output the reading plan to the user. The reading plan should be created keeping in mind that the user would like to begin and end reading a particular “chapter” of the book on the same day.
Write an algorithm to check whether a given number is an Armstrong number. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 33 +73 + 13 = 371
Write an algorithm which multiplies two numbers using the minimum number of additions.
You are given two array of “n” length. First array contains the starting time of meetings. Second array contains the ending time of those meetings. Write an algorithm that detects meeting conflicts.
1. Correlation between two variables X&Y is 0.85. Now, after adding the value 2 to all the values of X, the correlation co-efficient will be______
2. A) Read the given dataset “Tips.csv” as a dataframe “Data”. Give 3 commands to extract the columns in the following sequence - Time, TotalBill, Tips?
B) Read the given excel sheet ‘Tips1.xlsx’ as a dataframe ‘Data1’. What command should be given to merge the two data frames ‘Data’ and ‘Data1’ by columns?
C) Copy the 'Data1' dataframe as 'Data2' (Data2 = Data1.copy()) and identify the command to find the total tips received across Day’s from the dataframe ‘Data2’?
Write a Python class, Rectangle. The class will have instance variables length and width
and a method which will compute the area of a rectangle. Include the constructor and
other required methods to set and get class attributes. Also, include a method isSquare(),
which returns a Boolean value indicating if the shape is a square. (Hint: use @property)