Python Forum

Full Version: Help! new to python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
can someone help me to solve this



1. Given a four-digit number, perform its cyclic rotation by two digits. Try to solve it only by using numerical method.
Example:

Input: 1234
Output: 3412

2. Given a radius of the circle, calculate the area of the circle
Example:

Input radius: 12
Output area: 452.3893421169302
Hint: Try to find area of the circle formula

3. Given two two-digit numbers, merge their digits as shown in the tests below. Try to solve using only numerical method.

Input 1: 34
Input 2: 98
Output: 3948

4. Given a string. Create a program to remove the character you want
Input string: ‘I am a student at colorado school of mines’

Input character to remove: ‘a’
Output: ‘I m colordo school of mines

5. Given a string consisting of exactly two words separated by a space. Print a new string with the first- and second-word positions swapped (the second word is printed first).

Input: ‘San Francisco’
Output: ‘Francisco San'
Welcome to the forum. We are glad to help, but we are reluctant to do homework for other people. You need to show some effort to solve them yourself. Then, when you are stuck, post your code in python tags, full traceback (if you get errors) - in error tags and ask specific questions
Quote:2. Given a radius of the circle, calculate the area of the circle
Example:

Input radius: 12
Output area: 452.3893421169302
Hint: Try to find area of the circle formula
Use the following formula : Area of circle = π*r^2
For the first one, divide by 100 and take the integer part. Then take the input and mod by 100, multiply the result of the mod by 100 and add the two parts together.

Similar approach to the third one.