Practice10 - Operasi String With Python

Overview

Operasi String

instagram instagram instagram

MY SOSIAL MEDIA :

instagram
facebook
twiter
whatapp

Apa itu Python String ?

String adalah urutan simbol yang terbatas yang dipilih dari himpunan yang disebut alfabet.

  • String adalah jenis yang paling populer di Python.
  • Untuk membuatnya hanya dengan melampirkan karakter dalam tanda kutip.
  • Python memperlakukan tanda kutip tunggal sama dengan tanda kutip ganda.
  • Membuat string semudah memberi nilai pada sebuah variabel.

main.py

OUTPUT PROGRAM eza

Deskripsi

1. Bagaimana menghitung jumlah karakter pada string ?
cara menghitung karakter pada string yaitu menggunakan method len( )
Contoh:

print(len('Hello World'))

methode len() pada python di gunakan untuk menghitung karakter pada string.

2. Bagaimana cara mengambil satu karakter pada string ?
cara mengambil satu karakter pada string yaitu dengan menggunakan kurung siku [ ] dan deklarasi nomor di dalam kurung siku dengan urutan ARRAY dan menggunakan titik dua lalu masukan nomor ARRAY selanjutnya.
Contoh:

print(txt[10])

3. Bagaimana Cara Mengambil Karakter ke 2 s/d 4 ?
cara menggambil karakter 2 s/d 3 menggunakan kurung siku yang di deklarasi nomor ARRAY
Contoh:

print(txt[2:5])

4. Bagaimana cara menghilangkan spasi pada string ?
cara menghilangkan spasi pada string yaitu menggunakan method replace()
contoh:

txt = "Hello World"
print(replace(txt[5]))

methode replace() mengganti semua kemunculan string lama dengan yang baru atau paling banyak kemunculan.

5.Bagaimana cara menguah string menjadi huruf besar atau hurup kecil ?
cara merubah hurup besar/kecil pada string yaitu menggunakan methode:

  • upper() untuk memperbesar
  • lower() untuk memperkecil
    contoh:
txt = "Hello world"
print(txt.upper()) #memperbesar
print(txt.lower()) #memperkecil

6.Bagaimana cara mengganti karakter pada string ?
Contoh mengganti karaket H menjadi J pada karakter "Hello World" :

txt = "Hello World"
print(replace(txt[:1]))

di sini cara mengganti karakter masih menggunakan method replace( ) dan di deklarasi nomor ARRAY pada kurung siku.

Owner
Maulana Reza Badrudin
instagram : @rezastein_ ๐Ÿฆ๐Ÿฆ๐Ÿฆ๐Ÿฆ๐Ÿฆ๐Ÿฆ๐Ÿฆ—๐ŸฆŽ๐ŸŠ๐Ÿ€๐Ÿ’๐Ÿฆง๐Ÿฃ๐Ÿ–๐Ÿฆ๐ŸฆŸ๐ŸŒ๐Ÿฆ‹๐Ÿผ๐Ÿฆ๐Ÿฅœ๐Ÿบ๐ŸงŠ๐Ÿฅ’๐ŸŒถ๏ธ๐ŸŒ๐Ÿฅ๐Ÿฅ ๐Ÿกโ˜•๐Ÿฉ๐Ÿฅš๐Ÿฅฅ
Maulana Reza Badrudin
Badge-Link-Creater 'For more beautiful profiles.'

Badge-Link-Creater 'For more beautiful profiles.' Ready Badges Prepares the codes of the previously prepared badges for you. Note Click here for more

Mรผcahit Gรผndรผz 9 Oct 19, 2022
One-stop-shop for docs and test coverage of dbt projects.

dbt-coverage One-stop-shop for docs and test coverage of dbt projects. Why do I need something like this? dbt-coverage is to dbt what coverage.py and

Slido 106 Dec 27, 2022
synchronize projects via yaml/json manifest. built on libvcs

vcspull - synchronize your repos. built on libvcs Manage your commonly used repos from YAML / JSON manifest(s). Compare to myrepos. Great if you use t

python utilities for version control 200 Dec 20, 2022
A python package that computes an optimal motion plan for approaching a red light

redlight_approach redlight_approach is a Python package that computes an optimal motion plan during traffic light approach. RLA_demo.mov Given the par

Jonathan Roy 4 Oct 27, 2022
log4shell pwner for vulnerable minecraft servers

Log4-hell name supposed to be Log4$hell but oh well log4shell pwner for vulnerable minecraft servers install all reqs python + a minecraft client for

1 Jan 05, 2022
A toy repo illustrating a minimal installable Python package

MyToy: a minimal Python package This repository contains a minimal, toy Python package with a few files as illustration for students of how to lay out

Fernando Perez 19 Apr 24, 2022
Jack Morgan's Advent of Code Solutions

Advent-of-Code Jack Morgan's Advent of Code Solutions Usage Run . initiate.sh year day To initiate a day. This sets up a template python file, and pul

Jack Morgan 1 Dec 10, 2021
Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Automatic Parallel Parking: Path Planning, Path Tracking & Control This repository contains a python implementation of an automatic parallel parking s

134 Jan 09, 2023
Module 2's katas from Launch X's python introduction course.

Module2Katas Module 2's katas from Launch X's python introduction course. Virtual environment creation process (on Windows): Create a folder in any de

Javier Mรฉndez 1 Feb 10, 2022
Easily map device and application controls to a midi controller

pymidicontroller Introduction Easily map device and application controls to a midi controller

Tane Barriball 24 May 16, 2022
Block fingerprinting for the beacon chain, for client identification & client diversity metrics

blockprint This is a repository for discussion and development of tools for Ethereum block fingerprinting. The primary aim is to measure beacon chain

Sigma Prime 49 Dec 08, 2022
1. ๋„ค์ด๋ฒ„ ์นดํŽ˜ ๋Œ“๊ธ€์„ ๋นจ๋ฆฌ ๋‹ค๋Š” ๊ธฐ๋Šฅ

naver_autoprogram ๊ธฐ๋Šฅ ์„ค๋ช… ๋„ค์ด๋ฒ„ ์นดํŽ˜ ๋Œ“๊ธ€์„ ๋นจ๋ฆฌ ๋‹ค๋Š” ๊ธฐ๋Šฅ ๋„ค์ด๋ฒ„ ์นดํŽ˜ ์ž๋™ ์ถœ์„ ์ฒดํฌ ๊ธฐ๋Šฅ ๋™์ž‘ ๋ฐฉ์‹ ์นดํŽ˜ ๋Œ“๊ธ€ ๊ธฐ๋Šฅ ๊ธฐ๋ณธ ๋™์ž‘์€ ์ฃผ๊ธฐ์ ์ธ ์Šค์ผ€์ฅด ๋™์ž‘์œผ๋กœ ํ•ด๋‹น ์นดํŽ˜ ID ์™€ ํŠน์ • API ์ฃผ์†Œ๋กœ ๋Œ€์ƒ์ด ์ƒˆ๊ธ€์„ ์ž‘์„ฑํ–ˆ๋Š”์ง€ ์ฒดํฌ. ํ•ด๋‹น ๋Œ€์ƒ์ด ์ƒˆ๊ธ€ ๋“ฑ

1 Dec 22, 2021
A simple calculator that can add, subtract, multiply or divide depending upon the input from the user

Calculator A simple calculator that can add, subtract, multiply or divide depending upon the input from the user. In this example, we should have the

Jayesh Mali 1 Dec 27, 2021
Write a program that works out whether if a given year is a leap year

Leap Year ๐Ÿ’ช This is a Difficult Challenge ๐Ÿ’ช Instructions Write a program that works out whether if a given year is a leap year. A normal year has 36

Rodrigo Santos 0 Jun 22, 2022
kurwa deska ADB

kurwa-deska-ADB kurwa-deska ะ—ะฐะฟัƒัะบ Linux -- python3 kurwa_deska.py Termux -- python3 kurwa_deska.py ะ’ัั‚ะฐะฝะพะฒะปะตะฝะฝั cd kurwa_deska ADB ั– ะทั€ะฐะทัƒ ะทะฐะฟัƒัะบ pyt

1 Jan 21, 2022
Fixed waypoint(pose) navigation for turtlebot simulation.

Turtlebot-NavigationStack-Fixed-Waypoints fixed waypoint(pose) navigation for turtlebot simulation. Task Details Task Permformed using Navigation Stac

Shanmukha Vishnu 1 Apr 08, 2022
Set up a sidechain for the XRPL quickly and easily

Sidechain Launch Kit Introduction This directory contains python scripts to tests and explore side chains. This document walks through the steps to se

Xpring Engineering 15 Dec 08, 2022
A set of simple functions to upload and fetch pastes on paste.uploadgram.me

pastegram-py A set of simple functions to upload and fetch pastes on paste.uploadgram.me. API Documentation Methods upload_paste(contents: bytes, file

Uploadgram 3 Sep 13, 2022
Simple dependency injection framework for Python

A simple, strictly typed dependency injection library.

BentoML 14 Jun 29, 2022
The FLARE team's open-source library to disassemble Common Intermediate Language (CIL) instructions.

dncil is a Common Intermediate Language (CIL) disassembly library written in Python that supports parsing the header, instructions, and exception hand

MANDIANT 95 Jan 08, 2023