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
***
one year ago
Please elaborate a little. If this is related to some course or project. Please share the details.
2 years ago
Please WhatsApp on +919354261828 for better support.
2 years ago
Please share the level number and lesson number.
2 years ago
Please share the level number and lesson number.
2 years ago
This should have ben easy:
***
let cars=["Lexus", "Jeep", "Audi", "BMW"];

cars[0] = cars[2];

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

var myVar;
console.log(myVar);

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



CSS Syntax



Welcome to Studytonight




***
2 years 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)
}
***
2 years ago
Is it in the interactive course? Please share the level number and lesson number
2 years ago
Please share the level number and lesson number.
2 years ago