“Python zum Java Converter online” Code-Antworten

Python zum Java Converter online

import urllib
url = "https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-usa.txt"
file = urllib.request.urlopen(url)
words = []
for line in file:
    decoded_line = line.decode("utf-8")
    words.append(decoded_line[:-1])

           
Rich Reindeer

Python zum Java Converter online

fecha=input("Fecha (formato 'día, DD/MM'): ")
fecha=fecha.lower()
diasemana=fecha[0:fecha.find(',')]
dianro=int(fecha[fecha.find(',')+2:fecha.find('/')])
mesnro=int(fecha[fecha.find('/')+1:])
if dianro>31 or mesnro>12:
    print("Fecha incorrecta")
else:
    if diasemana in "lunes,martes,miércoles":
        respuesta=input("¿Se tomaron exámenes? S/N: ")
        if respuesta.lower()=="s":
            aprobados=int(input("Cantidad de aprobados: "))
            reprobados=int(input("Cantidad de reprobados: "))
            print("Porcentaje de aprobados:", (aprobados*100)/(aprobados+reprobados), "%")
    elif diasemana=="jueves":
        asistencia=int(input("Porcentaje de asistencia: "))
        if asistencia>50:
            print("Asistió la mayoría")
        else:
            print("No asistió la mayoría")
    elif diasemana=="viernes":
        if dianro==1 and (mesnro==1 or mesnro==7):
            print("Nuevo ciclo")
            alumnos=int(input("Cantidad de alumnos: "))
            arancel=float(input("Arancel: $"))
            print("Ingreso total: $", alumnos*arancel)
    else:
        print("Fecha incorrecta")
print("Fin del programa")
BrayanYesit AngelCasta¤eda

Python zum Java Converter online

print("hola Mundo")
Terrible Toad

Python zum Java Converter online

b,e=map(int,input().split())
print(pow(b,e))
Datla Rohit

Python zum Java Converter online

a=int(input())
print(a)
Happy Herring

Python zum Java Converter online

n = int(input("Enter n: "))
i = 1
flag = 0
while i < 10000000:
    if i == n:
        i = i + 1
        continue
    if i % n == 0:
        x = [int(a) for a in str(i)]
        b = sum(x)
        if b == n:
            print("Value is:", i)
            flag = 1
            break
    i = i + 1
if flag == 0:
    print(-1)
Spidy Parker

Python zum Java Converter online

import math
import array
total = array.array('i',[])
i = 0
t = int(input())
while i<t :
    count = 0;
    s = input()
    for j in s :
        if j == 'a' or j == 'e' or j == 'i' or j == 'o' or j == 'u' :
           count+=1
    cons = len(s) - count
    factcons = math.factorial(cons)
    factvowl = math.factorial(count)
    factdiff = math.factorial(abs(cons-count))
    total.append(int(factcons*factvowl*(cons+1)*factcons/(factvowl*factdiff)))
    i+=1
for ele in total :
   print(ele)
Confused Cassowary

Python zum Java Converter online

import serial
import serial.tools.list_ports

SUCTION_ON = [0xAA, 0xAA, 0x04, 0x3E, 0x01, 0x01, 0x01, 0xBF]
SUCTION_OFF = [0xaa,0xaa,0x04,0x3e,0x01,0x00,0x00,0xc1]
ports = serial.tools.list_ports.comports()
print([port.name for port in ports]) # print port list
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1) # open serial port
print(ser.name) # check which port was really used
ser.write(bytearray(SUCTION_OFF)) # write a string
ser.close() # close port
Xenophobic Xenomorph

Python zum Java Converter online

import java.io.IOException;
import java.util.Scanner;

public class AMudanca {
  public static void main(String[] args) throws IOException {
  	Scanner leitor = new Scanner(System.in);
  	String msg;
  	
  	while (leitor.hasNext()) {
  		int graus = leitor.nextInt();
  		
  		if (graus == 360 || graus >= 0 && graus < 90) msg = "Bom Dia!!";
  		else if (graus >= 90 && graus < 180) msg = "Boa Tarde!!";
  		else if (graus >= 180 && graus < 270) msg = "Boa Noite!!";
  		else msg = "De Madrugada!!";
  		
  		System.out.println(msg);
  	}
  	
  	leitor.close();
  }
}
Average Alpaca

Python zum Java Converter online

def number(n):
    x=1
    while(n>0):
        x=x*(n%10)
        n=n//10
    return x
def digsum(n):
    sum=0
    while(n>0):
        sum=sum+(n%10)
        n=n//10
    return sum
def value(n):
    a="1"*n
    b="9"*n
    for i in range(int(a),int(b)):
        if(number(i)==digsum(i)):
            return i
n=int(input())
print(value(n))
Zany Zebra

Ähnliche Antworten wie “Python zum Java Converter online”

Fragen ähnlich wie “Python zum Java Converter online”

Weitere verwandte Antworten zu “Python zum Java Converter online” auf Java

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen