Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

Try this:
***
def count_occurrences(s1, s2):
count = 0
for i in range(len(s1) - len(s2) + 1):
if s1[i:i+len(s2)] == s2:
count += 1
return count

s1 = 'timisverytimidbuthasnotime'
s2 = 'tim'
print(count_occurrences(s1, s2)) # Output will be 2
***
12 months ago
Please elaborate a little. If this is related to some course or project. Please share the details.
one year ago
Please WhatsApp on +919354261828 for better support.
one year ago
Please share the level number and lesson number.
one year ago
Please share the level number and lesson number.
one year ago
This should have ben easy:
***
let cars=["Lexus", "Jeep", "Audi", "BMW"];

cars[0] = cars[2];

console.log(cars);
***
one year ago
fmt package is generally used for formatted input and output. Hence this is the most used package in Golang.
one year ago
Here is the answer:
***
// write your code here

var myVar;
console.log(myVar);

var myVar=null;
console.log(myVar);
***
one year ago
Here is the answer:
***



CSS Syntax



Welcome to Studytonight




***
one year ago
Sorry for the delay. Here is the answer:
***
package main
import (
"fmt"
"bufio"
"os"
"log"
)

func main() {
fmt.Println("Which programming language are you learning here:")
reader := bufio.NewReader(os.Stdin)
input, err := reader.ReadString('\n')
if err != nil {
log.Fatal(err)
}
fmt.Println(input)
}
***
one year ago
Is it in the interactive course? Please share the level number and lesson number
one year ago
Please share the level number and lesson number.
one year ago