From a97a59d87593c11ee057040028733988998676c0 Mon Sep 17 00:00:00 2001 From: dishant976 <92664829+dishant976@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:26:55 +0530 Subject: [PATCH] Update 8-find-a-string-in-a-string.py --- .../8-find-a-string-in-a-string.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ch04-strings-and-string-methods/8-find-a-string-in-a-string.py b/ch04-strings-and-string-methods/8-find-a-string-in-a-string.py index 024ba62..99fc587 100644 --- a/ch04-strings-and-string-methods/8-find-a-string-in-a-string.py +++ b/ch04-strings-and-string-methods/8-find-a-string-in-a-string.py @@ -8,13 +8,9 @@ # Exercise 2 -# Replace every occurrence of the character `"s"` -# with the character `"x"` -phrase = "Somebody said something to Samantha." -phrase = phrase.replace("s", "x") -print(phrase) -# NOTE: This leaves the capital "S" unchanged, so the -# output will be "Somebody xaid xomething to Samantha." +#Find value 2.0 in user input +my_input = input("Enter your input") +print(my_input.find("2.0")) # Exercise 3
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: