string in python | Lec-17

In this video, I have talked about the fundamentals of programming and Python. If you complete this, you will be well-versed in using tuples for different use cases.
Directly connect with me at:- topmate.io/manish_kumar25
Q1. Swap the case of the string without using swapcase
inbuilt method for string
Input:- Programming Aasan Hai
Output:- pROGRAMMING aASAN hAI
Q2. Print the list of all unique ip addresses?
Input:-
"/region//us-east-a/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.155.2/file_path//usr/bin/test1.csv",
"/region//us-east-b/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.156.2/file_path/teams/bin/test1.csv",
"/region//us-east-c/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.151.2/file_path/teams/bin/test1.csv",
"/region/japan/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.155.22/file_path/data/bin/test1.csv",
"/region/india/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.167.2/file_path//usr/bin/test1.csv",
"/region//us-east-a/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.179.28/file_path//usr/bin/test1.csv",
"/region//us-east-b/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.155.31/file_path/worklog/bin/test1.csv",
"/region//us-east-c/north/resource/vminsatnce/subsid/ae-456-df/server/10.168.151.2/file_path//tmp/bin/test1.csv"
]
Output:- ["10.168.155.2","10.168.156.2","10.168.151.2"
"10.168.155.22","10.168.167.2",
"10.168.179.28","10.168.155.31" ]
Discord channel:- / discord
For more queries reach out to me on my below social media handle.
Follow me on LinkedIn:- / manish-kumar-373b86176
Follow Me On Instagram:- / competitive_gyan1
Follow me on Facebook:- / manish12340
My Second Channel -- / @competitivegyan1
Interview series Playlist:- • Interview Questions an...
My Gear:-
Rode Mic:-- amzn.to/3RekC7a
Boya M1 Mic-- amzn.to/3uW0nnn
Wireless Mic:-- amzn.to/3TqLRhE
Tripod1 -- amzn.to/4avjyF4
Tripod2:-- amzn.to/46Y3QPu
camera1:-- amzn.to/3GIQlsE
camera2:-- amzn.to/46X190P
Pentab (Medium size):-- amzn.to/3RgMszQ (Recommended)
Pentab (Small size):-- amzn.to/3RpmIS0
Mobile:-- amzn.to/47Y8oa4 ( Aapko ye bilkul nahi lena hai)
Laptop -- amzn.to/3Ns5Okj
Mouse+keyboard combo -- amzn.to/3Ro6GYl
21-inch Monitor-- amzn.to/3TvCE7E
27-inch Monitor-- amzn.to/47QzXlA
iPad Pencil:-- amzn.to/4aiJxiG
iPad 9th Generation:-- amzn.to/470I11X
Boom Arm/Swing Arm:-- amzn.to/48eH2we
My PC Components:-
intel i7 Processor:-- amzn.to/47Svdfe
G.Skill RAM:-- amzn.to/47VFffI
Samsung SSD:-- amzn.to/3uVSE8W
WD Blue HDD:-- amzn.to/47Y91QY
RTX 3060Ti Graphic card:- amzn.to/3tdLDjn
Gigabyte Motherboard:-- amzn.to/3RFUTGl
O11 Dynamic Cabinet:-- amzn.to/4avkgSK
Liquid cooler:-- amzn.to/472S8mS
Antec Prizm FAN:-- amzn.to/48ey4Pj

Пікірлер: 25

  • @Timezonee
    @Timezonee2 ай бұрын

    Bhaiya aap Apna according continue kro Lectures ko and . Thanks for your efforts

  • @user-sf7xi7zw6f
    @user-sf7xi7zw6fАй бұрын

    for i, string in enumerate(Input): Input[i] = string.split("/server/")[1].split("/")[0] print(list(set(Input)))

  • @ishaangupta4941
    @ishaangupta49412 ай бұрын

    Very nice and helpfull series sir ! After this can you pls make a series on DB designing and concepts. Some of the common designs might be ( Cab system, trading app, shopping app , movie , streaming platforms etc ). Thanks

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    Noted

  • @GaurangDeshani
    @GaurangDeshani2 ай бұрын

    Que:1 Solution:- originalStr = "WOrd" swapCaseStr = "" for char in originalStr: if ord(char) = 65: value = ord(char) + 32 swapCaseStr = swapCaseStr+chr(value) elif ord(char) >= 97 and ord(char)

  • @NaveenKumar-ln9vg
    @NaveenKumar-ln9vgАй бұрын

    input = "Programming Aasan Hai" lst = [] for char in input: if char.islower(): lst.append(chr(ord(char)-32)) else: lst.append(chr(ord(char)+32)) output = (''.join(lst).replace("@",' ')) print(output)

  • @safiadawood5637
    @safiadawood56372 ай бұрын

    I could have used RegEx but I don't have a good hang of it

  • @user-sf7xi7zw6f
    @user-sf7xi7zw6fАй бұрын

    Input = "Programming Aasan Hai" lst =[] for i in Input: if i.islower(): lst.append(i.upper()) else: lst.append(i.lower()) print(''.join(lst))

  • @chauhannirav569
    @chauhannirav5692 ай бұрын

    Hi sir, which languages or tools or Database you are preferred starting data engineering..

  • @chauhannirav569

    @chauhannirav569

    2 ай бұрын

    For fresher, I am currently studying bca last semester I have starting journey with data engineering.

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    Language- Python Database- MySql

  • @nupoornawathey100
    @nupoornawathey1002 ай бұрын

    Pls share questions in description

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    Done

  • @chauhannirav569
    @chauhannirav5692 ай бұрын

    DB series but PostgreSql okay

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    Yes complete ok

  • @yashiyengar7366
    @yashiyengar73662 ай бұрын

    Solution 1: def swap_case(stryng): Output = "" for i in stryng: if i == i.lower(): Output += i.upper() else: Output += i.lower() return Output print(swap_case(Output)) Solution 2: def uniq_ip_finder(Input): output = [] for i in Input: for j in i.split("/"): if "10." in j: output.append(j) output = list(set(output)) return output print(uniq_ip_finder(Input))

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    ip can't be always 10. Something it can be anything

  • @yashiyengar7366

    @yashiyengar7366

    2 ай бұрын

    @@manish_kumar_1 can I use a regex pattern to find the ip ?

  • @manish_kumar_1

    @manish_kumar_1

    2 ай бұрын

    @@yashiyengar7366 yes you can.

  • @yashiyengar7366

    @yashiyengar7366

    2 ай бұрын

    @@manish_kumar_1 This should do the job then hopefully it covers all edge cases. import re def uniq_ip_finder(input_list): ip_pattern = r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b' output = [] for i in input_list: matches = re.findall(ip_pattern, i) output.extend(matches) output = list(set(output)) return output output = uniq_ip_finder(input_list) print(output)