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 :: Django url with primary key 
Python :: zipfian distribution python 
Python :: how to for loop length print in python 
Python :: no pattern 
Python :: Django LogEntry or Change History 
Python :: poython command options 
Python :: lipa na mpesa daraja python 
Python :: how do you amke function in python 
Python :: download python 3.6 64 bit for windows 7 
Python :: MEMORY MANAGEMENT SYSTEM IN PYTHON 
Python :: leer fichero linea por linea python 
Python :: The Bytearray Type 
Python :: python get pc runtime 
Python :: change size of image and fir it into numpy array opencv 
Python :: logartim normalization python pandas 
Python :: the coding train 
Python :: how to make a tuple 
Python :: wand image resize 
Python :: python chunks iterator 
Python :: padnas get list of rows 
Python :: argmin returns one value for 2d array 
Python :: unpacking of tuples in python 
Python :: how to convert hash to string in python 
Python :: Kinesis Client get_records example 
Python :: email slicer in python code user input 
Python :: anagram game 
Python :: import nifti to numpy 
Python :: how to check for non-datetime value in python 
Python :: skip security check selenium linkedin python 
Python :: pydictionary 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =