String indexing in Python is easy ✂️

preview_player
Показать описание
#python #tutorial #course

00:00:00 string indexing
00:05:17 last 4 digits exercise
00:06:27 reverse a string exercise
00:07:06 conclusion

# indexing = accessing elements of a sequence using [] (indexing operator)
# [start : end : step]

credit_number = "1234-5678-9012-3456"

print(credit_number[0])
print(credit_number[0:4])
print(credit_number[:4])
print(credit_number[4:8])
print(credit_number[4:])
print(credit_number[-1])
print(credit_number[-4:])
print(credit_number[::2])
print(credit_number[::3])

# EXERCISE 1
credit_number = "1234-5678-9012-3456"
# last_digits = credit_number[-4:]
# print(f"XXXX-XXXX-XXXX-{last_digits}")

# EXERCISE 2
credit_number = "1234-5678-9012-3456"
credit_number = credit_number[::-1]
print(credit_number)
Рекомендации по теме
Комментарии
Автор

# indexing = accessing elements of a sequence using [] (indexing operator)
# [start : end : step]

credit_number = "1234-5678-9012-3456"

print(credit_number[0])
print(credit_number[0:4])
print(credit_number[:4])
print(credit_number[4:8])
print(credit_number[4:])
print(credit_number[-1])
print(credit_number[-4:])
print(credit_number[::2])
print(credit_number[::3])

# EXERCISE 1
credit_number = "1234-5678-9012-3456"
# last_digits = credit_number[-4:]
#

# EXERCISE 2
credit_number = "1234-5678-9012-3456"
credit_number = credit_number[::-1]
print(credit_number)

BroCodez
Автор

Wanted to thank you Bro code, thanks to your lessons I learned Java and now I'm way ahead of my course in school and that made my life so easier, also im looking forward to learning other programming languages with your teaching

KDX
Автор

Less time, Very quality teaching. Your name defines you Bro Code!!

okbe
Автор

I love your videos so much! You have helped me a lot! I am currently struggling with importing and using other python files to the main python file... Could you please do a video about writing and reading from other python files?
Thanks

eyalsilbershtein
Автор

Bro your Python Vids were just a gold mine for me and many of my friends. Less time quality teaching thanks for it bro


one request :- Can you start JS or React Js course and also some python projects??

sohambachhav
Автор

Hey @BroCode,
Love your channel.
I really liked your previous logo for the channel, and also the introductory + concluding short funny monologues, like in javaFX videos.
Please bring that vibe back❤

preraksemwal
Автор

WOW! can't imagine how good are u at python!

Afghanistanfutsalfans
Автор

very easy to understand ..thanks @Bro Code

deborahchirambo
Автор

Well, that's quick! Keep up the good works!

earth
Автор

great straight forward video. please do one on regex.

fhd
Автор

bro this video came out just i was doing string indexing with array for my game
THNX

molifer
Автор

Late to this party. Currently heading through Intro to Scripting. Found your channel and love it. Thank you! Sub’d.

Toothless_Rides
Автор

Sir how did you learn all these technologies? What are learning strategies couldnu share ? You are an inspiration, love from India♥️

brajagopalmukherjee
Автор

Can you try doing some Python exercises, like completing questions by coding in Python

ninjapirate
Автор

Is there any full course of python that you have prepared. I would like to learn from you. I’m new to programming and struggling to get the logic.

Ravi.Kumar-
Автор

Is that thumbnail your way of saying that you are locked in a basement forced to make coding tutorials?

piptxt
Автор

Awesome video Bro, hope you get to 1 mil soon

basscat
Автор

Can you make a renewed" How to make Snake Game"

ryanswn
Автор

Sir, can u explain recursion in python?

lukavardanidze
Автор

yo bro can u make a lua tutorial pls? also nice video

volitive