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 :: clase describe algo 
Python :: when was python 3.8 released 
Python :: how to take input a matrix using map in python 
Python :: How to call any function with it name as a string 
Python :: run selenium webdriver without opening browser 
Python :: django rest serializer depth 
Python :: python audio graph live stream 
Python :: numpy add to same index multiple times 
Python :: timedistributed pytorch 
Python :: google.api_core.exceptions.ServiceUnavailable: 503 The datastore operation timed out, or the data was temporarily unavailable when using stream 
Python :: break statement python 
Python :: python stop running instances 
Python :: Take input of any number and generate all possible binary strings without recursion 
Python :: print n times 
Python :: Display tail of the DataFrame 
Python :: Python Tkinter Frame Widget Syntax 
Python :: The get() method on Python dicts and its "default" arg 
Python :: python Least prime factor of numbers till n 
Python :: how to install apps in django 
Python :: python async get result 
Python :: print anything in python 
Python :: install robobrowser python 3 
Python :: datetime.timedelta 
Python :: how to classify numbers in python 
Python :: django check if related object is None 
Python :: quicksort python3 
Python :: how do i re-restablish the third reich 
Python :: double char 
Python :: mylist = [“hello”, “bye”,”see ya”,”later”] phrase = mylist[1] 
Python :: django template child data in nested loop 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =