주말 작업
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)

Python은 배우고 사용하기 쉽고 C는 더 강력하지만 복잡합니다. 1. Python Syntax는 간결하며 초보자에게 적합합니다. 동적 타이핑 및 자동 메모리 관리를 사용하면 사용하기 쉽지만 런타임 오류가 발생할 수 있습니다. 2.C는 고성능 응용 프로그램에 적합한 저수준 제어 및 고급 기능을 제공하지만 학습 임계 값이 높고 수동 메모리 및 유형 안전 관리가 필요합니다.

제한된 시간에 Python 학습 효율을 극대화하려면 Python의 DateTime, Time 및 Schedule 모듈을 사용할 수 있습니다. 1. DateTime 모듈은 학습 시간을 기록하고 계획하는 데 사용됩니다. 2. 시간 모듈은 학습과 휴식 시간을 설정하는 데 도움이됩니다. 3. 일정 모듈은 주간 학습 작업을 자동으로 배열합니다.

Python은 개발 효율에서 C보다 낫지 만 C는 실행 성능이 높습니다. 1. Python의 간결한 구문 및 풍부한 라이브러리는 개발 효율성을 향상시킵니다. 2.C의 컴파일 유형 특성 및 하드웨어 제어는 실행 성능을 향상시킵니다. 선택할 때는 프로젝트 요구에 따라 개발 속도 및 실행 효율성을 평가해야합니다.

하루에 2 시간 동안 파이썬을 배우는 것으로 충분합니까? 목표와 학습 방법에 따라 다릅니다. 1) 명확한 학습 계획을 개발, 2) 적절한 학습 자원 및 방법을 선택하고 3) 실습 연습 및 검토 및 통합 연습 및 검토 및 통합,이 기간 동안 Python의 기본 지식과 고급 기능을 점차적으로 마스터 할 수 있습니다.

Python과 C는 각각 고유 한 장점이 있으며 선택은 프로젝트 요구 사항을 기반으로해야합니다. 1) Python은 간결한 구문 및 동적 타이핑으로 인해 빠른 개발 및 데이터 처리에 적합합니다. 2) C는 정적 타이핑 및 수동 메모리 관리로 인해 고성능 및 시스템 프로그래밍에 적합합니다.

Pythonlistsarepartoftsandardlardlibrary, whileraysarenot.listsarebuilt-in, 다재다능하고, 수집 할 수있는 반면, arraysarreprovidedByTearRaymoduledlesscommonlyusedDuetolimitedFunctionality.

파이썬은 자동화, 스크립팅 및 작업 관리가 탁월합니다. 1) 자동화 : 파일 백업은 OS 및 Shutil과 같은 표준 라이브러리를 통해 실현됩니다. 2) 스크립트 쓰기 : PSUTIL 라이브러리를 사용하여 시스템 리소스를 모니터링합니다. 3) 작업 관리 : 일정 라이브러리를 사용하여 작업을 예약하십시오. Python의 사용 편의성과 풍부한 라이브러리 지원으로 인해 이러한 영역에서 선호하는 도구가됩니다.

과학 컴퓨팅에서 Python의 응용 프로그램에는 데이터 분석, 머신 러닝, 수치 시뮬레이션 및 시각화가 포함됩니다. 1.numpy는 효율적인 다차원 배열 및 수학적 함수를 제공합니다. 2. Scipy는 Numpy 기능을 확장하고 최적화 및 선형 대수 도구를 제공합니다. 3. 팬더는 데이터 처리 및 분석에 사용됩니다. 4. matplotlib는 다양한 그래프와 시각적 결과를 생성하는 데 사용됩니다.
