Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Strings Q1
- # text = input("Enter a long sentence: ")
- # print(text.count("the") + text.count("The"))
- # par = '''On July 16, 1969, the Apollo 11 spacecraft launched from the Kennedy Space Center in Florida. Its mission was to go where no human being had gone before—the moon. The crew consisted of Neil Armstrong, Michael Collins, and Buzz Aldrin. The spacecraft landed on the moon in the Sea of Tranquility, a basaltic flood plain, on July 20, 1969. The moonwalk took place the following day. On July 21, 1969, at precisely 10:56 EDT, Commander Neil Armstrong emerged from the Lunar Module and took his famous first step onto the moon’s surface. He declared, That’s one small step for man, one giant leap for mankind. It was a monumental moment in human history.'''
- ### Strings Q2
- # list_of_sentences = par.split(".")
- # print("\n".join(list_of_sentences))
- ### Strings Q3
- # word = input("Enter a word: ")
- # result = ""
- # for c in word:
- # if c in "aeiouAEIOU":
- # result += c.upper()
- # else:
- # result += c.lower()
- # print(result)
- ### Strings 4
- # resp = ""
- # while resp != "exit":
- # resp = input("Enter your email address")
- # resp = resp.lower()
- # if resp.count("@") == 1 and resp.count(".") >= 1:
- # print("Valid Email")
- # else:
- # print("Invalid Email")
- ### Strings Q5
- # resp = ""
- # while resp != "exit":
- # resp = input("Hey, What do you want to do today?")
- # resp = resp.lower()
- # if resp == "movies":
- # print("I will open Netflix")
- # elif resp == "music":
- # print("I'll open Spotify.!")
- # elif resp == "shopping":
- # print("I'll enter Amazon")
- # else:
- # print("Sorry I don't understand.")
- ### Strings 4
- # resp = ""
- # while resp != "exit":
- # resp = input("Enter your email address")
- # resp = resp.lower()
- # if resp.count("@") == 1 and resp.count(".") >= 1:
- # print("Valid Email")
- # else:
- # print("Invalid Email")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement