python – Text Wrap using return and print

We give you a chain S and a width w.
Your task is to wrap the string in a paragraph of width w.
Input format
The first line contains a string, S.
The second line contains the width, w.

Example of input
Example of exit

I tried the code, but I did not get the required result. As 2 additional lines enter the exit.
Note: the last 4 lines of the code are immutable (not to be modified)

import textwrap

def wrap(string, max_width):

    for i in range(0,len(string),y):

if __name__ == '__main__':
    string, max_width = input(), int(input())
    result = wrap(string, max_width)

How to remove users from a Google Cloud Print shared printer?

Once I've added users to a shared printer, I do not know how to delete them. Clicking on "share" from the owner's account gives me a menu that is almost what I want, but there is no drop-down list by user roles. In similar G Suite dialogs, there would be a drop-down list for each user.

Google Cloud Print

I hope that I will not have to recreate this printer every time I want to delete people. Is it possible to delete users without doing it?

Error printing when I try to access the print queue: "Windows can not access the device, path or file specified …"

Complete error message:

Windows can not access the specified device, path, or file. You may not have the appropriate permissions to access the item.

Why would my printer give me this error all at once? I can not print anything either – the queue is blocked or something like that!

android – HP Laserjet Printer – Google Cloud Print, multiple page printing

At work, we have an HP Laserjet printer. We connected it to Google Cloud Print so all users in the workplace could log in and print. Recently, we had more than 200 pages printed with HTTP information …

GET /privet/info?client_name=android-app HTTP/1.1
Android-Api: 27
X-Privet-Token: ""
User-Agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; SM-T580 Build/M1AJQ)
Connection: Keep-Alive
Accept-Encoding: gzip

That's what's printed all the time.
This seems to come from the tablets that we have but I've tried everything I can think of, like restarting tablets, removing the print cache, changing some printer settings but nothing has changed.

Has anyone else had a problem like this or does he have any idea why this is happening? Disabling port 9100 seems to solve the problem, but some of our computers can not connect to the printer via WiFi, which is necessary for some applications.

Any help is greatly appreciated.
Thank you

Print a document for all Google Group members with the merged data

I'm looking for a way to print a Google Doc template for all members of Google OR, by merging last name, first name, and email address.
Are there features for which I should write a Google App script? In this last case, I could list the data of the members in a Google sheet and browse the lines, replace the data of the document and print them ….

For example (pseudocode)

- get list from google sheets
- foreach member in list
--- replace data in template
--- print

A better idea?

Best payment per print programs?


I'm looking for a program that allows me to place ads on my site, but I get paid for impressions instead of clicks for a site with a very low CTR. No suggestion?

Thanks, Matt

java – My code does not work, just print data

I am new to Java and my codes do not work. My idea is to print the code, the model, the mileage and other characteristics of the vehicle, as well as print the stock at the time of the sale of a car, but it does not work. the data and the stock variable do not recognize me either, I have studied a lot with videos, etc., sometimes I do exactly the same thing with video and although it happens to them, I have not no mistake, sometimes Eclipse asks me for extra keys or; that they should not go, obviously I do not put them but it always tells me an error

public class Vehiculo {
    private int codigo;
    private String marca;
    private String tipo;
    private int modelo;
    private String patente;
    private char kilometraje;
    private int precio;
    private int stock;

    //Constructor por defecto
    public Vehiculo () {
        this.codigo = 123456;
        this.marca = "bmw";
        this.tipo = "auto";
        this.modelo = 2019;
        this.patente = "BKCL78";
        this.kilometraje = 0;
        this.precio = 7500000;
        this.stock = 8;

    //Constructor con atributos
    public Vehiculo (int vCodigo, String vMarca, String vTipo, int vModelo, String vPatente, char vKilometraje, int vPrecio, int vStock) {
        this.codigo = vCodigo;
        this.marca = vMarca;
        this.tipo = vTipo;
        this.modelo = vModelo;
        this.patente = vPatente;
        this.kilometraje = vKilometraje;
        this.precio = vPrecio;
        this.stock = vStock;


    public void setcodigo (int vCodigo) {
        this.codigo = vCodigo;
    public int getcodigo () {
        return codigo;
    public void setmarca (String vMarca) {
        this.marca = vMarca;
    public String getmarca () {
        return marca;
    public void settipo (String vTipo) {
        this.tipo = vTipo;
    public String gettipo () {
        return tipo;
    public void setmodelo (int vModelo) {
        this.modelo = vModelo;
    public int getmodelo () {
        return modelo;
    public void setpatente (String vPatente) {
        this.patente = vPatente;
    public String getpatente () {
        return patente;
    public void setkilometraje (char vKilometraje) {
        this.kilometraje = vKilometraje;
    public char getkilometraje () {
        return kilometraje;
    public void setprecio (int vPrecio) {
        this.precio = vPrecio;
    public int getprecio () {
        return precio;
    public void setstock (int vStock) {
        this.stock = vStock;
    public int getStock () {
        return stock;
    //Metodo vender:
    //Entrada para vender auto
    Scanner entrada = new Scanner (;

    public int vender() {

        int miVenta = entrada.nextInt();
        if (stock > miVenta) {
        this.stock = (this.stock - miVenta);
        return this.stock;
        System.out.println("Felicidades, su compra ha sido exitosa");
        System.out.println("Nuevo stock = "+this.stock);

public class Main {
    public static void main(String() args){
//Crear objeto
        Vehiculo v1 = new Vehiculo();
            System.out.println ("Marca:"+v1.getmarca());
            System.out.println ("Tipo:"+v1.gettipo());
            v1.setmodelo (2019);
            System.out.println ("Modelo:"+v1.getmodelo());
            v1.setpatente ("BKCL78");
            System.out.println ("Patente:"+v1.getpatente());
            v1.setkilometraje ('0');
            v1.setprecio (7500000);
            v1.setstock (8);
            System.out.println ("Stock:"+v1.getStock());

} ````

java – Print maximum of groups of three random ints

I'm trying to learn how to use continuous expressions and lambda. Here's the scenario: I have a collection of 10 Thing objects each containing an int () of 3 random numbers. I have written code to print the greatest number in every thing.

I have already written two statements and an accompanying method that print the desired result, but the code is rather rigorous … improvements and suggestions would be greatly appreciated.

import java.util.Random;
public class Thing {
    private Random r = new Random();
    private int a = r.nextInt(), b = r.nextInt(), c = r.nextInt();

    public int() getCollectionOfInts() {
        return collectionOfInts;

    private int() collectionOfInts = new int(){a, b, c};

}//end of class

//main in separate driver class
public static void main(String() args) {
        Thing() things = new Thing(10);
        int a=0,b=0,c=0;
        for (int x =0;x<10;x++){
            things(x) = new Thing();
            for (int y=0;ySystem.out.println(Stream.of(Thing.getCollectionOfInts()).mapToInt(z->z(0)>z(1)&&z(0)>z(2)?z(0):z(1)>z(2)?z(1):z(2)).reduce((x,y)->x+y).getAsInt()));
        //improper use of .max() or .mapToInt(...)?

    public static int maxInt(int() x) {
        int max=x(0);
        for (int y:x) {
                max = y;
        return max;

I'm getting the desired results for both streams, but I'm still not happy with how I'm doing it!

print – Can not print / save as pdf android 6.0

My samsung tab suddenly stopped printing in pdf. I realized that the default print service was missing. I've retrieved the print icon in the share menu by downloading Cloud Print and the Samsung Print Plug-in, but it just exceeds the selection option of & # 39; Printer, and do not print. I do not have any connected printer.

string – Print the words together and uppercase java

I would like you to help me with this code, the program must print two words together and in capital letters … for example: this dog —–> ESEPERRO … I hope your help …

    String ato = uno.getText();
     String atomo = tres.getText();
     tres.setText(atomo.replace(" ", ""));