subject

Hello, I need help writing some Python 3+ programs. The instructions are:1) Write a function rotate(s, n) that has one string parameter s followed by a positive integer parameter n. It returns a rotated string such that the last n characters have been moved to the beginning. If the string is empty or a single character, the function should simply return the string unchanged. Assume that n is less than or equal to the length of s and that n is a positive intger. For example: rotate('abcdefgh',3) returns 'fghabcde'2) Write a function named digit_count that takes one parameter that is a number (int or float) and returns a count of even digits, a count of odd digits, and a count of zeros that are to the left of the decimal point. Return the three counts in that order: even_count, odd_count, zero_count. Be careful of the "edge case" where the number starts with a decimal point—conversion of such a number to a string places a zero before the decimal point. See correct behavior in the final test case below. For example: digit_count(1234567890123) returns (5, 7, 1) digit_count(123400.345) returns (2, 2, 2) print(digit_count(123.)) returns (1, 2, 0) print(digit_count(.123)) returns (0, 0, 0)3) String has a method s. isdigit() that returns True if string s contains only digits and False otherwise, i. e. s is a string that represents an integer. Write a function named float_check that takes one parameter that is a string and returns True if the string represents a float and False otherwise. For the purpose of this function we define a float to be a string of digits that has at most one decimal point. Note that under this definition an integer argument will return True. Remember "edge cases" such as "45." or ".45"; both should return True. For example: float_check('1234') returns Truefloat_check('123.45') returns Truefloat_check('123.45.67') returns Falsefloat_check('34e46') returns Falsefloat_check('.45') returns Truefloat_check('45.') returns Truefloat_check('45..') returns False

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:30
In your ice breakers game, what happens when the snowball collides with one of the snowboards? a. the player's score will increase. b. the snowball will leave the play area. c. the snowball will be destroyed. d. the snowball will bounce.
Answers: 1
question
Computers and Technology, 22.06.2019 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
You know the right answer?
Hello, I need help writing some Python 3+ programs. The instructions are:1) Write a function rotate(...
Questions
question
Mathematics, 15.01.2021 04:40
question
Mathematics, 15.01.2021 04:40
question
Mathematics, 15.01.2021 04:40
question
Mathematics, 15.01.2021 04:40
question
Mathematics, 15.01.2021 04:40
Questions on the website: 13722361