Cov txheej txheem:

Hloov Python rau Loop rau Java: 12 Cov Kauj Ruam
Hloov Python rau Loop rau Java: 12 Cov Kauj Ruam

Video: Hloov Python rau Loop rau Java: 12 Cov Kauj Ruam

Video: Hloov Python rau Loop rau Java: 12 Cov Kauj Ruam
Video: Python! Writing pandas DataFrames to Multiple Tabs in a Spreadsheet 2024, Kaum ib hlis
Anonim
Hloov Python rau Loop rau Java
Hloov Python rau Loop rau Java

Nab hab sej thiab Java yog ob yam txuj ci thev naus laus zis loj tshaj plaws, siv los ntawm ntau lab txhua hnub. Nrog cov lus qhia no, txhua qib ntawm Python cov neeg siv tuaj yeem pib siv lawv cov txuj ci rau Java, kawm paub yuav siv lawv cov cai li cas tam sim no rau cov xwm txheej sau ua lwm yam lus, thiab kawm txog cov qauv thiab lub ntsiab lus ntawm cov lej thiab loops. Hauv qhov piv txwv no, peb yuav coj Python yooj yim rau lub voj los ntawm cov kab ntau ntawm cov lej thiab coj koj los ntawm cov txheej txheem hloov nws mus rau nws qhov sib npaug Java. Txog qhov kawg, koj yuav muaj Java ua haujlwm uas tuaj yeem ua haujlwm hauv Java IDE! Nov yog qee cov kauj ruam yooj yim kom pib koj txoj kev mus kawm Java:

Koj yuav xav tau:

- Tus kws kho kab ntawv yooj yim los ua haujlwm thaum kho koj cov cai

- Python Yooj Yim rau txoj cai voj (lossis ua raws nrog peb tus lej piv txwv)

- Yog tias koj xav sim koj li kev cai, IDE (Kev Txhim Kho Ib Leeg Ib puag ncig, lossis thaj chaw sau thiab khiav koj cov cai) uas khiav Java. Qee qhov piv txwv yog Eclipse, BlueJ, thiab NetBeans, uas yog txhua qhov pub dawb thiab nyab xeeb los rub tawm hauv Is Taws Nem. Lus ceeb toom: tsis txhob rub tawm yam tsis paub IDE- nws yuav ua rau koj lub computer puas tsuaj!

Kauj ruam 1:

Duab
Duab

Qhib cov ntawv tsis muaj ntaub ntawv.

Kauj ruam 2:

Duab
Duab

Luam lossis sau Python rau lub voj. Hauv qhov piv txwv no, peb tab tom hla tus lej 1 txog 4 (nrog 5 raws li peb tus nqi txiav tawm) thiab luam tawm txhua tus lej.

Kauj ruam 3:

Duab
Duab

Ntxiv semicolons mus rau qhov kawg ntawm txhua txoj kab hauv lub voj lub cev.

Kauj ruam 4:

Duab
Duab

Tshem cov nyuv ntawm qhov kawg ntawm kev tshaj tawm voj.

Kauj ruam 5:

Duab
Duab

Muab lub cim pib uas qhov semicolon siv los (tom qab tshaj tawm lub voj).

Kauj Ruam 6:

Duab
Duab

Muab tus kab zauv xaus rau ntawm qhov kawg ntawm lub voj lub cev, ntawm thawj kab khoob.

Kauj ruam 7:

Duab
Duab

Tshem tag nrho cov ntawv nruab nrab ntawm "rau kuv" thiab pib kab ntawv, hais qhia hauv daim duab saum toj no.

Kauj ruam 8:

Duab
Duab

Hloov "i" rau "int i =?;", Hloov? nrog tus lej pib ntawm qhov koj xav tau ntau yam.

Kauj ruam 9:

Duab
Duab

Ntxiv "kuv <?;", Hloov? nrog qhov txiav tawm tus nqi (tsis suav nrog) ntawm qhov koj xav tau ntau yam.

Kauj ruam 10:

Duab
Duab

Ntxiv "i ++" mus rau qhov kawg ntawm kev tshaj tawm lub voj.

Kauj ruam 11:

Duab
Duab

Muab cov lus tshaj tawm hauv lub voj (txhua yam tom qab rau thiab ua ntej bracket) hauv kab lus.

Kauj ruam 12:

Duab
Duab

Hloov cov nqe lus hauv lub voj lub cev rau Java. Hauv qhov no, hloov "luam" mus rau "System.out.println".

Pom zoo: