Type Casting Par-06

WBOY
Release: 2024-08-31 14:37:21
Original
708 people have browsed it

Type Casting Par-06

I'm bored sitting in front of the computer. The brain needs a little refreshment. So I went for a walk in the afternoon. walking on the road Loud noise of cars around. These words are ringing in the ears. Coming to seek a little peace comes great turmoil. So I came a little away from the city, there is no loud noise of cars. Pleasant environment. The place is like a jungle. There are many plants around. The trees are very large in size. Estimated age will be 30-40 years. There are a few that are a little smaller in size. Maybe 10-15 years old.

The place looks great. Came here in early spring. A gentle breeze is also blowing. When falling on the body, a strange sensation is created in the soul. feels good It would have been better to have someone special with you. After walking around for a while, I saw a broken house. Very old house, about 50-60 years ago. Wanted to take a look at the house. So I entered the house. Inside is a bit dark. After wandering around the house for a while, I saw something like a round coin lying down. What is this again? I picked it up with my hand and it looked like a coin but a little thicker. What could be the thing?

Wait a second, I'm here to hang out. There is no point in stressing about these things. For this, I put the object in my pocket and started walking around.

Anyway it feels good. The brain is completely fresh. I suddenly remembered that I was supposed to publish a blog today. But I completely forgot. Nothing was written. So I got out of there. Time took a little longer. It is already evening.

It is 6 pm. When I first came and washed my hands and face, I remembered the object in my pocket. The thing is very dirty. I tried to wash it with water. Nothing happened. No, it won't be this way. Something different needs to be done. How about toothpaste?

치약과 낡은 칫솔을 가지고 작업을 시작했어요. 처음엔 치약을 바르고 한동안 칫솔질을 했어요. 조금 정리되었습니다. 나는 몇 가지 더 동일한 작업을 수행했습니다. 클리어는 잘 되고 있어요. 이것이 진행되는 방식입니다. 잠시 후 치약이 나오지 않습니다. 치약이 끝났다는 것을 이해합니다.

지금은 꽤 잘 청소 중입니다. 척이 낄낄거린다. 매우 하얗게 보입니다. 그레이 컬러처럼요. 물체는 뭔가 은빛처럼 보이지만 확실하지 않습니다. 어떻게든 금 조각이 있었다면 그걸 팔아 큰 사람이 된 뒤 일어나 슈퍼컴퓨터를 가동했을 것이다. 하지만 그럴 것 같지는 않습니다. 금은 더 이상 회색이 아닙니다. 나는 더 이상 슈퍼컴퓨터를 구입하지 않았습니다.

글쎄요, 같은 물건이 하나가 아니라 수천 개가 있다면, 남은 인생은 이렇게 붓을 문지르며 지나갈 것입니다. 이것을 위한 기계를 만드는 것은 어떻습니까? 돈을 넣어서 돌려드리겠습니다. 이런 기계가 있으면 참 좋을 것 같아요.

그런데 잘 안 되더라구요. 나는 단 하나의 개체만을 가지고 있으며 이미 지운 개체입니다. 그런 기계는 필요하지 않습니다.

모든 것을 내려놓고 컴퓨터 앞에 앉았습니다. 블로그에 글을 쓰겠습니다

오늘의 주제는 Python의 Type Casting입니다. 위 이야기를 읽으셨다면 이미 타입 캐스팅의 개념을 이해하신 것입니다. 간단히 말해서 Type Casting은 데이터의 데이터 유형을 변경하는 것입니다.

이제 "200"의 데이터 유형이 무엇인지 묻는다면?

답은 매우 간단합니다. 숫자입니다. 아니요, 숫자가 아닙니다. 눈치채시면 인용문 안의 숫자를 보실 수 있습니다. 그리고 인용문 안에 있는 것은 모두 문자열입니다.

이제 숫자로 변환하라는 요청을 받으면 어떻게 될까요?

쉽기도 하고 견적도 내어드립니다.

당신의 대답이 맞습니다. 하지만 질문을 조금 바꾸면 문제가 발생합니다.

데이터를 입력해야 하는 소프트웨어를 구축한다고 가정해 보겠습니다. 아니오로 복용해야합니다.

이제 무엇을 해야 할까요? 여기서는 견적을 받을 수 없습니다.

예를 들면 주제를 이해할 수 있습니다.

으르레

여기서 출력은 입니다. . 이제 정수로 변환해야 합니다. 단, 조건은 첫 번째 줄의 코드를 터치할 수 없다는 것입니다.

Python에는 이를 수행하는 int() 함수가 있습니다. 다음 코드를 복사하여 실행해 보세요.

으르레

출력은 무엇입니까?

int() 함수 외에도 두 가지 함수가 더 있습니다.

  • float() 함수는 float 데이터 유형을 .
  • 로 변환하는 데 사용됩니다.
  • str() 함수는 문자열을 데이터 유형으로 변환하는 데 사용됩니다.

이제 남은 두 가지를 연습하고 스크린샷을 댓글로 남겨주세요.

블로그 작성을 마치겠습니다.

친구가 전화를 해서 한동안 이야기를 나눴어요. 대화 중 어느 시점에서 나는 그가 내가 받은 물건을 청소하는 기계를 가지고 있다는 것을 알게 되었다. 나는 샤라를 꾸짖었다. 미리 말했더라면 내 치약이 낭비되지 않았을 텐데. 시간도 선택되었습니다. 치약을 새로 사야해요.

The above is the detailed content of Type Casting Par-06. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!