Python - help!

 
Vista:
sin imagen de perfil

help!

Publicado por nicolas (1 intervención) el 14/05/2023 08:25:58
hello! I need to pass this code to function.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
nombre1 = input("ESCRIBA UN NOMBRE Y UN APELLIDO: ")
  categoria= input ("INGRESE CATEGORIA:")
  sueldo1 = float(input(f"INGRESE EL SALARIO DE {nombre1}: "))
  antiguedad = int(input("INGRESE ANTIGUEDAD:"))
  if categoria == "a" and antiguedad <= 10:
    print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.05), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.05))
  elif categoria == "a" and antiguedad >=10 and antiguedad <=15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.10), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.10))
  elif categoria == "a" and antiguedad >15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
 
 
  elif categoria == "b" and antiguedad <= 10:
    print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.10), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.10))
  elif categoria == "b" and antiguedad >=10 and antiguedad <=15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
  elif categoria == "b" and antiguedad >15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.20), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.20))
 
  if categoria == "c" and antiguedad <= 10:
    print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
  elif categoria == "c" and antiguedad >=10 and antiguedad <=15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.20), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.20))
  elif categoria == "c" and antiguedad >15:
    print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.25), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.25))
  else:
    print("error")
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alejandro

help!

Publicado por Alejandro (11 intervenciones) el 31/05/2023 17:52:01
  • Alejandro se encuentra ahora conectado en el
  • chat de PHP
Only write def name_of_your_funciton(): at start of your code and indent the code.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar