Questions: 1 027

Free Answers by our Experts: 948

It is very hard to master any of programming language and many students have troubles with it. That is why we have decided to render assistance for those who have difficulties with Python. Python problems are very common among students. They are tired of constant Python questions and try to find the Python answers. Ask your questions here and be sure to get the 100% truthful answers. The only thing you will have to do – is to send the request with Python questions and to have no hesitation that all your Python questions will be satisfied.

Ask Your question

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 & Filtering

Write a program to output the following

**********

*. *

* PYTHON *

*. *

**********


Write a one-line program to output the following haiku.

A lightning flash:

between the forest trees

I have seen water.

Shiki


2. By studying the oscillations of a simple pendulum, the acceleration of free fall g on the surface of a planet is determined. For this purpose the formula serves: T = 2 × pi kat the square root of l / g, where T is the period of oscillations and l - the length of the pendulum. Experimental measurements performed on the Earth show that the total time for one hundred oscillations of the pendulum with length I = 1 m is t = 200 S. a) Calculate the acceleration of free fall on the surface of the Earth. b) Calculate the radius of the Earth, knowing that its mass is M = 6 × 10²⁴ kg. Dihet range = 6.67 × 10 ‐ ¹¹ Nm² / kg²


Write a program to output the following

___

( ‘ ‘ )

( (

) )

( (

) )

( (

) )

( (

) )

V


1. Write a python function called calculateSum that takes two integer arrays of the same length and calculates the sum array (by adding elements in the same index).

Sample

Arguments: [2, 5, 6, 5]. 7,3, 3, 2]

Function wll return: (9, 8, 9, 7]


3. Write a python function called removePunctuation that takes as an argument a string. representing a sentence and returns a copy of the string with all punctuation removed.

Sample:

Argument: "Hello?! Let's try to solve this exercise, it will be easy :)!"

The function will return: Hello Lets try to solve this exercise it will be easy (Hint: You may use string built-in functions: isalnum) to check for every character if the character is alphanumeric (letter or digit) and isspace) to check if it is a space. Remove any character that is neither an alphanumeric, nor a space)


2. Write a python function called upperLower that takes a string as an argument and returns: the number of uppercase letters, the number of lowercase letters and the positive difference between those two.

Sample:

Argument: ThiS iS A SamPle sentENCE.

The function will return: (9, 12, 3)

Explanation of result: There are 9 Upper case letters, 12 Lower case letters and the positive difference is 3. (Hint: Use string built-in functions isupper) and islower0 to check if a letter is uppercase or lowercase)


 A single-player plays the game with the computer. The deck is composed of 16 cards: ● 3 black 1's, 2 black 2's, 2 black 3's and 1 black 4 ● 3 white 1's, 2 white 2's, 2 white 3's and 1 white 4 The aim is to stack the cards one by one in sorted order in the stack (blacks from 1 to 4 and whites from 1 to 4). Game Rules: Starting the game: ● The deck is shuffled and three cards are dealt with each player. ● Players can only see their partner's hand. They can not see their own hands. ● In the beginning, players have a total number of 3 tips. ● In the beginning, players have a total number of 2 lives. ● The stack is empty. ● The trash is empty. Playing the game: ● Game is played in turns. In each turn, a player selects one of the following moves: ○ Give tip: Player spends a tip (if there is any) and gives some information to his/her partner about his/her cards: ■ The tip can only be about the colour or the value of the cards. For example, you can not say a card is a black 2. You can either say it is black or it is 2. ■ The tip has to include the location of all cards which have the same value or the same colour. For example, if your partner's hand is “black 1, white 1, white 3”, you can not say the first card is 1 or the second card is white. You have to say the first and second cards are 1 or second and third cards are white. ○ Stack card: Player picks one of his/her own cards to place in the stack and draws a new card from the deck (if there is any). ■ If the card can be stacked, it is added in the stack. ■ Otherwise, the card is added to the trash and a life is lost. ○ Discard a card: Player picks one of his/her own cards to place in the trash and draws a new card from the deck (if there is any). One tip is earned. The game ends when: ● no lives left (zero), or ● no cards left to play, or ● the stack has all 8 cards ● The final score is the total number of cards in the stack. Obviously, the maximum possible score is 8.


write code using the range function to add up the series 20, 30, 40,...90


Write a program to output the following

^ ^

( o o )

v


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS