Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

c++ to python 3 converter

#include <bits/stdc++.h>
using namespace std;
bool isSubstring(string s1, string s2)
{
    int n = s1.size();
    int m = s2.size();
    for (int i = 0; i < n - m + 1; i++)
    {
        int j;
        for (j = 0; j < m; j++)
        {
            if (s1[i + j] != s2[j])
                break;
        }
        if (j == m)
            return true;
    }
    return false;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        string s;
        cin >> s;
        if (isSubstring(s, "101") || isSubstring(s, "010"))
        {
            cout << "Tasty" << endl;
        }
        else
            cout << "Tasteless" << endl;
    }
    return 0;
}
Comment

c++ to python 3 converter

#include <bits/stdc++.h>
using namespace std;
bool isSubstring(string s1, string s2)
{
    int n = s1.size();
    int m = s2.size();
    for (int i = 0; i < n - m + 1; i++)
    {
        int j;
        for (j = 0; j < m; j++)
        {
            if (s1[i + j] != s2[j])
                break;
        }
        if (j == m)
            return true;
    }
    return false;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        string s;
        cin >> s;
        if (isSubstring(s, "101") || isSubstring(s, "010"))
        {
            cout << "Tasty" << endl;
        }
        else
            cout << "Tasteless" << endl;
    }
    return 0;
}
Comment

c++ to python

#include



using namespace std;



int main(){



int n;



bool resposta = true;



for(int i=0; i<8; i++){



cin>>n;



if(n >1) resposta = false;



}



if(resposta)



cout<<"S"<< endl;



else



cout<<"F"<



}
Comment

c++ converter to python

#include <iostream>
using namespace std;
int main()
{
    int puppies, kitties;
    cout<<"Enter the number of puppies: ";
    cin>>puppies;
    cout<<"Enter the number of kitties: ";
    cin>>kitties;
    if(puppies <= 1)
        cout<<"You have adopted "<<puppies<<" puppy ";
    else
        cout<<"You have adopted "<<puppies<<" puppies ";
    if(kitties <= 1)
        cout<<"and "<<kitties<<" kitty";
    else
        cout<<"and "<<kitties<<" kitties";
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Python :: KivyMD video recording 
Python :: pandas continues update csv with exception 
Python :: get the values of your aws tags from ec2 instance 
Python :: python multiprocessing queu empty error 
Python :: scipy get frequencies of image 
Python :: drop mili sencond from datetime index 
Python :: python using string to access objects 
Python :: python for loop start at index with enumerate 
Python :: list all subdirectories up to a level 
Python :: qtoverlay 
Python :: hypercorn initiate 
Python :: invalid literal for int() with base 10 python 
Python :: mechanize python #6 
Python :: deine dict with same values 
Python :: snake game using python 
Python :: python dynamic csvnfile joining 
Python :: 4.3.3. Reassigning Variables 
Python :: check variable type godot 
Python :: Find number of triangles that can be made by given sides of triangle 
Python :: double except python 
Python :: collecion.alt shopify python 
Python :: Pyturch training along with source code 
Python :: Find Factors of a Number Using for Loop 
Python :: Code to find maximum number using if else 
Python :: stop level of the broker 
Python :: word search engine in python 
Python :: python jupyter show cell execution progress bar 
Python :: how to print hello world in python stack overflow 
Python :: display colors in python console 
Python :: Python NumPy asarray_chkfinite Function Example Raises Value Error 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =