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

Write a function called Reverse that takes in a string value and returns the string with the characters in reverse. If the string reads the same forwards as it does backwards the function should output “[word] is a palindrome!”.


Ex:

Reverse(“apple”)

outputs elppa

Reverse(“racecar”)

outputs racescar is a palindrome!


Hint: Make sure you take in your input and then make it lower case using the .lower() method.




Define a function named "calAverage" which take a list of integers as parameter. This function will then calculate and store the average into a variable named "result". Finally, the function MUST return the result with 2 decimal place only. For Example given the following list, [2,6,8,3,4,6], the function will return 4.83 (float).


Define a function named "secondLarge" which take a list of numbers (integer) as parameter. This function will then identify and return the 2nd largest number in the list. The function will return smallest number if the parameter only contains two numbers. While the function will return the only number if the list contain only single number. On some odd case, the function will return -999 if the parameter contains other datatype i.e. string or floaat in the list.


Define a function named "isValidPassword" which take a string as parameter. The function will

then check if the supplied string fulfilled the following password criterias:

1) must have combination of uppercase and lowercase

2) must have at least 3 digits

3) must have at least 2 special character (including whitespace).

4) must have at least 10 characters (combination of alphanumeric and special symbol)

The function will return a Boolean value i.e. True if all criterias are met or return False

otherwise.

Make sure you test your function with every single possible input that may return False value

as well.



Create a Python script which will accept a positive integer (n) and any character then it will display the input character n times.


Sample Output:

Positive Integer (n) : 7

Input any Character : A

A A A A A A A


I need the code to have an output stated above.



Write the python program, which prints the following sequence of values in loops:

18,-27,36,-45,54,-63


print last Half of list from given N inputs


Write a Python code that will read 5 numbers from the user. Your program should print the first number, the sum of the first 2 numbers, the sum of the first 3 numbers, and so on up to the sum of 5 numbers.




==========================================================




Sample Input 1:



1



2



3



4



5




Sample Output 1:



1



3



6



10



15

New Dictionary

input is

42

output

AP

input

752

output

ABW


Stale ingrediants program in python

input format is

11 12 -13 -15 15 19 18

output is

-13 -15 11 12 15 18 19


LATEST TUTORIALS
APPROVED BY CLIENTS