Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help! new to python
#1
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'
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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
Reply
#4
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020