Python Answers

Questions answered by Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

How to convert the string fro camel case to snake case


sir in the above question id #176334 some erorr ocurred your output should be show this type

(0, 12, 17)
(0, 8, 21)
(12, 8, 9)

but original out put this

Sample Input 1

0 12 17 8 9 21

29




Sample Output 1

(0, 8, 21)

(0, 12, 17)

(8, 9, 12)




Sample Input 2

0 1 2 3 5 7 13 17 19 19

22




Sample Output 2

(0, 3, 19)

(0, 5, 17)

(1, 2, 19)

(2, 3, 17)

(2, 7, 13)

sir in this question #177142  original output doesn't come how to solve this question

your output was come above code is





  a python
is language
is programming
language a
programming python
python language


but original out is

Sample Input 1

raju always plays cricket




Sample Output 1

always cricket

cricket raju

plays raju




Sample Input 2

python is a programming language




Sample Output 2

a language

a python

is language

is programming

language python

programming python




Sample Input 3

to be or not to be




Sample Output 3

be be

be not

or to

to to

sir above code correct #176332 i.e out put should be show

[13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14]

[[13, 9, 5, 1], [14, 6, 7, 2], [15, 10, 11, 3], [16, 12, 8, 4]]


but original output should be show this manner


Sample Input 1
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
3

Sample Output 1
13 9 5 1
14 7 11 2
15 6 10 3
16 12 8 4

Sample Input 2
3 4
1 2 3 4
10 11 12 5
9 8 7 6
2
Sample Output 2
9 10 1 2
8 11 12 3
7 6 5 4


how to archive this



In python: For a string s, and a character as input, create a function that will print each character of s but when the character input appears in the string add an asterisk beside the matching character. Each time the letter appears add an extra asterisk.

make this a function and use for i in range()


Interleave Strings

Given two strings, write a program to merge the given two strings by adding characters in alternating order, starting with the first string. If a string is longer than the other, append the additional characters onto the end of the merged string.Input


The first line of input will contain a string.

The second line of input will contain a string.

The strings may contain special characters, digits and letters.Output


The output should be the merged stringExplanation


For example, if the given strings are "abc" and "pqrs", then alternating characters from each string are merged as "a" from "abc", "p" from "pqr", "b" from "abc" and so on ..., resulting in the merged string "apbqcr".



input:

5

0 -2

3 6

4 7

1 -3


expected output : 7x^4 + 6x^3 - x^2 - 3x - 2

your output: 7x^4 + 6x^3 - 1x^2 - 3x - 2


for this code this is the error

and i am using python 3.9



Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.


input : 5

0 2

1 3

2 1

4 7


expected output : 7x^4 + 6x^3 - x^2 - 3x - 2
    your output:  7x^4 + 6x^3 - 1x^2 - 3x - 2


please explain this why this is again show error

i am using python 3.9 version




now for this code this is the error throwing: please kindly rectify it as soon as possible



Errors/Warnings:

Traceback (most recent call last):

 File "main.py", line 18, in <module>

  print(sec_msg(input(),key))

EOFError: EOF when reading a line



for this code

input:

4

0 5

1 0

2 10

3 6

4

0 -5

1 0

2 -10

3 -6



output:

(nothing)


expected output:



LATEST TUTORIALS
APPROVED BY CLIENTS