주말 작업
1.화씨를 섭씨로 변환:
def fahrenheit_to_celsius(): celsius=(fahrenheit-32)*5/9 return celsius fahrenheit=float(input("Enter the Fahrenheit:")) celsius=fahrenheit_to_celsius() print("Celsius :",round(celsius,1)
Enter the Fahrenheit:102.3 Celsius : 39.1
2.섭씨에서 화씨로 변환:
def celsius_to_fahrenheit(): fahrenheit=celsius*9/5+32 return fahrenheit celsius=float(input("Enter the Celsius:")) fahrenheit=celsius_to_fahrenheit() print("Fahrenheit :",round(fahrenheit,1))
Enter the Celsius:39.1 Fahrenheit : 102.4
3.피트를 미터로 변환:
def feet_to_meter(): meter=feet*0.3048 return meter feet=float(input("Enter the Feet:")) meter=feet_to_meter() print("Meter :",round(meter,3))
Enter the Feet:12 Meter : 3.658
4.사각형의 면적 찾기:
def area_of_square(): area=side**2 return area side=float(input("Enter the Side:")) area=area_of_square() print("Area :",round(area,2))
Enter the Side:12.3 Area : 151.29
5.직사각형의 넓이 찾기:
def area_of_rectangle(): area=length*width return area length=float(input("Enter the Length:")) width=float(input("Enter the Width:")) area=area_of_rectangle() print("Area :",round(area,2))
Enter the Length:13.4 Enter the Width:9.6 Area : 128.64
6.원의 면적 찾기:
def area_of_circle(): area=3.14*radius**2 return area radius=float(input("Enter the Radius:")) area=area_of_circle() print("Area :",round(area,2))
Enter the Radius:7.2 Area : 162.78
7.SGD에서 INR로 변환:
def sgd_to_inr(): inr=63.14*sgd return inr sgd=float(input("Enter the SGD:")) inr=sgd_to_inr() print("INR:",round(inr,2))
Enter the SGD:23 INR: 1452.22
8.싱가포르 시간을 인도 표준시로 변환:
from datetime import datetime, timedelta current= datetime.now() current_time= current.strftime("%H:%M:%S") print("Singapore Time:",current_time) difference= timedelta(hours=2, minutes=30) print("Difference between Singapore and Indian Time",difference) difference=current-difference print("Indian Time:",difference.strftime("%H:%M:%S"))
Singapore Time: 01:32:00 Difference between Singapore and Indian Time 2:30:00 Indian Time: 23:02:00
9) 7, 10, 8, 11, 9, 12, 10
no=7 count=0 while count<7: print(no, end=" ") if count%2==0: no=no+3 else: no=no-2 count+=1
7, 10, 8, 11, 9, 12, 10
10) 36, 34, 30, 28, 24, 22
no=36 difference=2 while no>=22: print(no,end=" ") if difference==2: no=no-difference difference+=2 else: no=no-difference difference-=2
36, 34, 30, 28, 24, 22
11) 22, 21, 23, 22, 24, 23
no=22 difference=1 while no<25: print(no,end=" ") if difference==1: no=no-difference difference+=1 else: no=no+difference difference-=1
22, 21, 23, 22, 24, 23
12) 53, 53, 40, 40, 27, 27
no=53 difference=13 while no>=27: print(no, end=" ") print(no, end=" ") if difference==13: no=no-difference
53, 53, 40, 40, 27, 27
13) 21, 9, 21, 11, 21, 13, 21
odd_no=21 even_no=9 count=0 while count<7: if count%2==0: print(odd_no,end=" ") else: print(even_no,end=" ") even_no=even_no+2 count+=1
21, 9, 21, 11, 21, 13, 21
14) 3, 4, 7, 8, 11, 12
no=3 difference=1 while no<=12: print(no,end=" ") if difference==1: no=no+1 difference+=2 else: no=no+3 difference-=2
3, 4, 7, 8, 11, 12
15) 14, 28, 20, 40, 32, 64
no=14 count=0 while count<6: if count%2==0: print(no, end=" ") no=no*2 else: print(no, end=" ") no=no-8 count+=1
14, 28, 20, 40, 32, 64
위 내용은 주말 작업의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Linux 터미널에서 Python 버전을 보려고 할 때 Linux 터미널에서 Python 버전을 볼 때 권한 문제에 대한 솔루션 ... Python을 입력하십시오 ...

Fiddlerevery Where를 사용할 때 Man-in-the-Middle Reading에 Fiddlereverywhere를 사용할 때 감지되는 방법 ...

Python의 Pandas 라이브러리를 사용할 때는 구조가 다른 두 데이터 프레임 사이에서 전체 열을 복사하는 방법이 일반적인 문제입니다. 두 개의 dats가 있다고 가정 해

Uvicorn은 HTTP 요청을 어떻게 지속적으로 듣습니까? Uvicorn은 ASGI를 기반으로 한 가벼운 웹 서버입니다. 핵심 기능 중 하나는 HTTP 요청을 듣고 진행하는 것입니다 ...

Linux 터미널에서 Python 사용 ...

10 시간 이내에 컴퓨터 초보자 프로그래밍 기본 사항을 가르치는 방법은 무엇입니까? 컴퓨터 초보자에게 프로그래밍 지식을 가르치는 데 10 시간 밖에 걸리지 않는다면 무엇을 가르치기로 선택 하시겠습니까?

Investing.com의 크롤링 전략 이해 많은 사람들이 종종 Investing.com (https://cn.investing.com/news/latest-news)에서 뉴스 데이터를 크롤링하려고합니다.
