Комментарии:
love all lectures
ОтветитьBro list tuple dict diff
ОтветитьCongratulations 🎊 🎉 incoming Nike CEO
ОтветитьVery very thanks 🙏❤❤sir❤❤ for given continue lectures ❤❤
ОтветитьRishab,
I would also like to inquire about the completion timeline for the Python tutorial playlist. Could you please provide an overview of the remaining topics that will be covered? This information would help me gauge the expected duration for completing the series. Thank you.
Hello Rishab😊😊😊,
I would like to express my gratitude for the excellent👌👌 Python tutorial videos you have created. I have been following your content closely, and I truly appreciate your teaching style, which is both engaging and approachable.
Below are my answers to the assignment you provided.
TOPIC - STRINGS IN PYTHON – BELOW ARE THE ANSWERS FOR THE QUESTIONS YOU ASKED US TO DO IT.
1. limit the decimal places to 2 digits using .format method and print the result, for the variable pi = 3.14159265359
pi = 3.14159265359
result = "{:.2f}".format(pi)
print(result)
2. extract the characters from 2 to 8 with a step of 2. given my string "Python Course", slice characters from index 2 to 8, skipping every other char
my_string = "Python Course"
result = my_string[2:8:2]
print(result)
3. slice to get only the middle character(s): For my_string ='Madhav', use slicing to extract the middle character(s)
my_string = 'Madhav'
length = len(my_string)
# For even length, slice two middle characters
if length % 2 == 0:
mid_left = length // 2 - 1
mid_right = length // 2 + 1
result = my_string[mid_left:mid_right]
else:
# For odd length, slice the single middle character
middle = length // 2
result = my_string[middle]
print(result)
4. remove the first 3 and last 3 characters: Given my_string = "Regression Analysis", remove the first 3 and last 3 characters.
my_string = "Regression Analysis"
result = my_string[3:-3]
print(result)
5. Get the substring that starts 4 characters from the end to the last character : for my_string ="Classification", slice the string starting from the 4th character from the end to the last character.
my_string = "Classification"
result = my_string[-4:]
print(result)
6. how to reverse a string using python string methods
my_string = "Hello, World!"
reversed_string = my_string[::-1]
print(reversed_string)
7. write a python function to check if a string is a palindrome using string methods?
def is_palindrome(my_string):
my_string = my_string.replace(" ", "").lower()
return my_string == my_string[::-1]
test_string = "A man a plan a canal Panama"
print(is_palindrome(test_string))
8. Difference between find() and index() in python ?
Return Value
find(substring):
Returns the lowest index of the substring if found.
Returns -1 if the substring is not found.
index(substring):
Returns the lowest index of the substring if found.
Raises a ValueError if the substring is not found.
Use find() if you prefer to check for a substring's presence without exceptions.
Use index() if you want to assert that the substring is present and handle errors explicitly.
Sir please loops kaa video bhi banaiye
ОтветитьBhai tumse ek baat puchni h kya mere data analyst mein job lg skti hai b.a kia hu 4 year gap h
Ответитьlet's Go ... Daily Videoo coming
Now it feels like Maybe this series can be completed in next two weeks ...
Daily New Video Aana Chahie Bhaiya ...
By the Way .. I'm Following Series From Day 1 ...
Hello Rishabh bhaiya
Aap iss course mein Python ke basics ke baad Libraries bghera karwaoge for data analysis??
And kitne din lag jayenge lagbhag complete hone mein??