No tienes acceso a esta clase

隆Contin煤a aprendiendo! 脷nete y comienza a potenciar tu carrera

脷ltima oportunidad para asegurar tu aprendizaje por 1 a帽o a precio especial

Antes: $249

Currency
$189/a帽o

Paga en 4 cuotas sin intereses

Paga en 4 cuotas sin intereses
Suscr铆bete

Termina en:

0D
6H
38M
12S

Characters

10/33
Recursos

Aportes 76

Preguntas 2

Ordenar por:

驴Quieres ver m谩s aportes, preguntas y respuestas de la comunidad?

o inicia sesi贸n.

(

//ejercicio 1
let nameCharacters: [Character] = ["J", "o", "s", "茅", " ", "M", "i", "g", "u", "e", "l", " ", "\u{1f1f2}"]
let nameString = String(nameCharacters)
print(nameString)
//ejercicio 2
let myNumber = 8
for index in 0...10 {
    print("\(myNumber) * \(index) = \(myNumber * index)")
}

馃槑

//reto 1
let myNameChars: [Character] = ["J", "u", "a", "n"]
var myNameString = String(myNameChars)
myNameString.append(colombianFlag)

//reto 2
var number = 2
for i in 0...10 {
    print(2*i)
}

```js // 1: Formar String a partir de Array: let myNameAndNationality : [Character] = ["C", "r", "i", "s", "t", "i", "a", "n", "\u{1F1E8}"] var arrayToString = String(myNameAndNationality) // 2: Elegir un n煤mero y crear la tabla de multiplicar mediante ciclo for: var myNumber = 5 for multiplier in 1...10 { // Range... print("\(myNumber) * \(multiplier) es \(myNumber * multiplier)") } ```// 1: Formar String a partir de Array: **let** myNameAndNationality : \[Character] = \["C", "r", "i", "s", "t", "i", "a", "n", "\u{1F1E8}"] **var** arrayToString = String(myNameAndNationality) // 2: Elegir un n煤mero y crear la tabla de multiplicar mediante ciclo for: **var** myNumber = 5 **for** multiplier **in** 1...10 { // Range... print("\\(myNumber) \* \\(multiplier) es \\(myNumber \* multiplier)") }

por que hacer una sola tabla si podemos hacer todas 馃槃

let array : [Int] = [1,2,3,4,5,6,7,8,9,10]

for multiplicando in array {
    print("Tabla de \(multiplicando):")
    for multiplicador in array {
        let resultado = multiplicando * multiplicador
        print("\(multiplicando) x \(multiplicador) = \(resultado)")
    }
    print("\n")
}
let country = "\u{1F1F2}"
var newName :[Character] = ["m","a","r","i","o"]
var strName = String(newName)
strName.append(country)
print(strName)
for i in 1...10 {
    for n in 1...10 {
        print("\(i)x\(n) = \(i*n)")
    }
}

Reto 1
let exclamationMark : Character = "!"
let nameCharacter: [Character] = [鈥淛鈥, 鈥渆鈥, 鈥渟鈥, 鈥渟鈥, 鈥渋鈥, 鈥渃鈥, 鈥渁鈥漖
var nameString = String(nameCharacter)
nameString.append(exclamationMark )

Reto 2
let number = 10
for i in 0鈥9{
print("(i+1) * (number) = ((i+1) * number)" )
}

//Reto:
//1)
let nombreChar:[Character] = ["L","U","I","S"," "]
var nombreString = String(nombreChar)
nombreString.append(nacionalidad) //Usando la variable previamente creada.

//2)
let multiplicador = 8

for i in 1...10 {
    var resultado = multiplicador * i
    print("\(multiplicador) x \(i) = \(resultado)")
}

ojo que juan no lo explica, pero el append no retorna un valor, por lo que queda en void, y si quieres imprimir con ese append, te retorna un ()

let nameCaracter2 : [Character] = ["R" , "A" , "U" , "L"]
var nameString2 = String(nameCaracter2)
let country = "\u{1F1EA}\u{1F1F8}"

var newName = "Me llamo \(nameString2) y soy de \(country)"
print(newName)

let number = 7
for table in 1...12{
    let res = number * table
    print("\(number) * \(table) = \(res)")
}
// Ejercicio 1
var name: [Character] = ["C","l","a","r","a"]
var imFrom: [Character] = ["s","o","y"," ","d","e"," "]
let flag: Character =  "\u{1F1E6}\u{1F1F7}"

imFrom.append(flag)

var message = "Hola! mi nombre es "
message.append(String(name) + ", ")
message.append(String(imFrom))

print(message)

// Ejercicio 2
let maxRange: Int = 10
let value: Int = 3

for i in 0...maxRange {
    print("\(value) * \(i) = \(i*value)")
}

// Ejercicio 1
var myName: [Character] = ["I", "n", "g", "r", "i", "d"]
myName.append("\u{1F1E8}\u{1F1F4}")

var myNameString = String(myName)
print(myNameString)

// Ejercicio 2
let myNumber = 3
for i in 0...10 {
    print("\(myNumber) * \(i) = \(myNumber * i)")
}

馃殌 Mis retos

Reto 1

let myLetters: [Character] = ["E", "d", "u", "a", "r", "d", "o"]
let myFlag: Character = "馃嚦馃嚠" // Nicaragua
var myName = String(myLetters)
myName.append(" \(myFlag)")

print(myName) // Eduardo 馃嚦馃嚠

Reto 2

let table = 8
for num in 1...12 {
    let result = table * num
    print("\(table) * \(num) = \(result)")
}

let tablaDelSiete = 7
for i in 0鈥9 {
let count = i+1
let multi = count * tablaDelSiete
print("(tablaDelSiete) * (i+1)" , 鈥= (multi)鈥)
}

Comparto Otra manera de hacerlo

//Any me sirve para recibir cualquier tipo de dato
func TablaMultiplicar(nume:Any)->String{

  //guard es un tipo de assert que si no se cumple hace lo que esta dentro del bloque
  guard let num=nume as? Int else { // as? Int es una manera de pregunta si el dato es Int, esto devuelve un bool 
    return "No se pudo leer el Numero"
  }
  var cadena = String()
  
  for i in 1...10{
      cadena += "\(num) X \(i) = \(num*i)\n"
    }
  return cadena
}

print(TablaMultiplicar(nume:"dw"))

//reto 1
let miNombre : [Character] = [鈥淢鈥, 鈥渁鈥, 鈥渞鈥, 鈥渃鈥, 鈥渙鈥漖
let bolivianFlag = 鈥淺u{1F1E7}\u{1F1F4}鈥
var msg = 鈥淢i nombre es (String(miNombre)) y soy de (bolivianFlag)鈥
//reto 2
let tabla = 5
for i in 0鈥9 {
print(鈥(i + 1) * (tabla) = ((i + 1) * tabla)鈥)
}

"Mi nombre es Marco y soy de 馃嚙馃嚧"
1 * 5 = 5
2 * 5 = 10
3 * 5 = 15
4 * 5 = 20
5 * 5 = 25
6 * 5 = 30
7 * 5 = 35
8 * 5 = 40
9 * 5 = 45
10 * 5 = 50

// Ejercicio Uno
let stringArray:[Character] = ["B","R","Y","A","N"," ","\u{1F1E8}\u{1F1F4}"]
let nameArray = String(stringArray)
print(nameArray)

// Ejercicio Dos
let num = 8
for i in 0...10{
    print("\(num) x \(i) = \(num * i)")
}

Yo lo solucione de la siguiente manera:

for i in 1...10 {
    for j in 1...10 {
        print("\(i) * \(j) = \(i*j)")
    }
    print()
}

Hice un bucle dentro de otro para saber varias tablas 馃槃

let tables = 7...8
for i in tables {
    print("Table of \(i)")
    for j in 1...10 {
        print ("    \(i) x \(j) = \(i*j)")
    }
}

let nameChars : [Character] = ["J","A","V","I","E","R"]
var nameString = String(nameChars)
let country = "\u{1F1EA}\u{1F1E8}"

var newName = "Me llamo \(nameString) y soy de \(country)"
print(newName)

let number = 7
for table in 1...12{
    let res = number * table
    print("\(number) * \(table) = \(res)")
}
var myName: [Character] = ["d","e","i","s","y"]
var newName = (String(myName))+flag
print(newName)


var numM = 3
for num in 0...10 {
    print("\(num)*\(numM) = \(numM*num)")
}

![](


let table = 4

for i in 0...9{
        
    let count = i+1
    let multp =  count * table
    print("\(i+1) * \(table) = \(multp)")
}

var nameSeba : [Character] = ["S", "E", "B", "A","S","T", "I", "A", "N"]
var nameSString = String(nameSeba)
nameSeba.append(exclamationMark)
var number = 4
for i in 0...10{
    print(i*4)
}

Reto cumplido! 馃槑

// Reto 01
let chMyName : [Character] = ["S", "o", "y", " ", "J", "o", "s", "e", " ", "y", " ", "v", "i", "v", "o", " ", "e", "n", " ", "\u{1f1f5}\u{1f1ea}"]
var myName = String(chMyName)
myName.append(exclamationMark)
myName += " 馃ぉ"
print(myName)

// Reto 02
let five = 5
for i in 0..<13 {
    print("\(five) * \(i) = \(five * i)")
}
var multiplo = 3
for i in 1...10 {
    print("3 * \(i) = ", multiplo * i)
}

Lo hice asi, no se si se podra mejorar 馃槂

let enteros = [1,2,3,4,5,6,7,8,9,10]

for (indice, value) in enteros.enumerated() {
  let i = indice + 1
print("\(value) x \(i) = \(i*value)")
}

let tablaTres = 3

for i in 1鈥10{
print (鈥3 x (i)鈥, i*tablaTres)
}

for i in 1鈥10{
print(" 3 * (i) = (i*3)" )
}

Reto 2:

let numberToCalculateTables = 8

for i in 1...10 {
    print("\(numberToCalculateTables) * \(i) = \(numberToCalculateTables * i)")
}

Reto 1:

let myDescriptionInChars: [Character] = ["F", "r", "a", "n", " ", "\u{1F1EA}", "\u{1F1F8}"]
print(String(myDescriptionInChars))

Por si se lo preguntaban, si el caracter es un let, y el message es un var, s铆 lo permite ya que var s铆 es mutable.

Reto 1 馃榿

Reto 2 馃榿

Mi ejemplo de c贸digo para imprimir las tablas de multiplicar.

import Foundation

let mensaje = "Tabla de multiplicar del numero: "
var producto = 0

for num in (1...10){
  print("\n",mensaje,num)
  for mul in (1...10){
    producto = num*mul
    print("",mul,".-",num," X ",mul," = ",producto)
  }
}
let multiplier = 7

print("La siguiente es la Tabla del 7 \n")

for i in 1 ... 10{
    print("\(multiplier) * \(i) = \(multiplier * i)")

La siguiente es la Tabla del 7

7 * 1 = 7
7 * 2 = 14
7 * 3 = 21
7 * 4 = 28
7 * 5 = 35
7 * 6 = 42
7 * 7 = 49
7 * 8 = 56
7 * 9 = 63
7 * 10 = 70

for i in 1...10 {
    let result = i * 3
    print("3 x \(i) = \(result)")
}
// un array con nuestro nombe y el emoji de bandera usando peru
let miNombre : [Character] = ["A","n","d","r","e"]
var mensaje = "Me llamo \(String(miNombre)) y soy de \(peruEmoji)"
mensaje.append(exclamationMark)

// usar numero y tabla de multiplicar
var numero : Int = 37
for i in 1...10{
    print("El elemento numero \(i) de la tabla del 37 es \(i) x \(numero) = \(numero * i)")
}

let number : UInt8 = 7

for i in 0鈥10 {
print("(number) * (i) = (number * UInt8(i))")
}

var numerosNew = ["1","2","3","4","5","6","7","8","9","10"]

for identiffic in 0..<numerosNew.count{
    for identiffic2 in 0..<numerosNew.count {
       
        print("La multipliccacion del numero \(identiffic2) * \(numerosNew[identiffic]) = \(identiffic2 * (identiffic+1))")
    }
    
}

Primer reto:

var name: [Character] = ["D", "i", "e", "s", "a", "n"]
name.append("\u{1F1E8}\u{1F1FA}")
let completeName = String(name)
print(completeName)

Tabla de multiplicar del 3

let numberToMultiply = 3

for number in 1...10 {
    print("\(numberToMultiply) * \(number) = \(numberToMultiply * number)")
}

retos 馃槃

// reto 1
let nameCompleteChar: [Character] = ["F","e","l","i","p","e"]
let nameCompleteString = String(nameCompleteChar)
print(nameCompleteString)

// reto 2
let multiplierTable:UInt8 = 5
for index in 1...10 {
    print("\(multiplierTable) x 1 = \(multiplierTable * UInt8(index))")
}

Reto 1

let greetingChars: [Character] = ["S", "o", "y", " ", "H", "e", "r", "n", "a", "n", " ", "d", "e", " "]
var greetingString = String(greetingChars)
greetingString.append(argentinaFlag)

Reto 2

let times_table = 5
for n in 0...10 {
    print("\(times_table) x \(n) = \(times_table * n)")
}

for id in 1鈥<10 {
print(" 10 x (id) = (id * 10)")
}
print()
for id in 1鈥<10 {
print(" 9 x (id) = (id * 9)")
}
print()
for id in 1鈥<10 {
print(鈥8 x (id) = (id * 8)鈥)
}
print()
for id in 1鈥<10 {
print(鈥7 x (id) = (id * 7)鈥)
}
print()
for id in 1鈥<10 {
print(" 6 x (id) = (id * 6)")
}

// Reto 1
let nameWill: [Character] = ["W", "i", "l", "s", "o", "n", " "]
let flagEcuador2 = "\u{1F1EA}" + "\u{1F1E8}"
var nameWString = String(nameWill)
nameWString.append(flagEcuador2)
print(nameWString)

//Reto 2
let number = 6
for i in 0...9 {
    print("\(i+1) * \(number) = \((i+1) * number)" )
}

馃槂

Es interesante ver como por ejemplo la variable name, es mutable y sin embargo no es posible modificar la propiedad name.count, supongo que es porque sus atributos son tipo 鈥渞eadonly鈥 o algo as铆.

let signoDeExclamacion: Character = "!"
let uname : [Character] = ["J", "o", "s", "茅"]
var sayName = String(uname)
sayName.append(signoDeExclamacion)

for i in 1...10{
    let multi = 5
    print("\(multi) * \(i) = \(i * multi)")
}```

// Reto
let multiplicarTabla = 3
for i in 0鈥10{
print("(multiplicarTabla) * (i) = (i * multiplicarTabla)")
}

// Challenge 1
var nombreBandera = "Hernan Maza \u{1F1EA}\u{1F1E8}"
print(nombreBandera)
//Challenge 2
var tableMultiplier = 3
for i in 0...10 {
    print("\(tableMultiplier) x \(i) = \(tableMultiplier * i)")
}

Mis respuestas 馃槂

// Task 1:
var myNameOfChars: [Character] = ["O", "s", "c", "a", "r"]
let myCountry: [Character] = ["\u{1F1F5}", "\u{1F1EA}"]
var myName = String(myNameOfChars)
myName.append(String(myCountry))

// Task 2:
var number: Int16 = 12
var limitTable: Int16 = 12
for i in 1...limitTable {
    print("\(number) x \(i) = \(number*i)")
}
var name: [Character] = ["B","r","a","d","l","e","y"," ","\u{1F1F2}\u{1F1FD}"]
var stringName = String(name)

var number = 2
for i in 1...10 {
    print(i * number)
}
for inx in 0...9 {
    print("\(inx + 1) * 8 = \((inx + 1) * 8)")
}```
<
let nameCharacters : [Character] = ["F", "R", "A", "N", "C", "I", "S", "C", "O"]
let lastNameCharacters : [Character] = ["G", "A", "R", "C", "I", "A"]

var nameString = String (nameCharacters)
var lastNameString = String (lastNameCharacters)

let compundName = nameString + lastNameString + String(CountryFlag)
print(compundName)
compundName.count
print(compundName.count)


var number = 2

for i in 1...10 {
    print( i * number)
}

var number3 = 3

for t in 1..<10 {
    print(t * number3)
}

var number5 = 5

for c in 1..<x5 {
    print(c * number5)
}
>
//Ejercicio 1
//let bandera = "\u{1F1E8}\u{1F1F4}"
let myNameChar: [Character] = ["J", "U", "A", "N", "S", "E", "\u{1F1E8}\u{1F1F4}"]
let myName = String(myNameChar)
//OUTPUT: JUANSE馃嚚馃嚧

///Ejercicio 2. n = 36
print("\n Tabla del 36")
for n in 0...10 {
    print("36 X \(n) = \(36 * n)")
}

/*OUTPUT
Tabla del 36
36 X 0 = 0
36 X 1 = 36
36 X 2 = 72
36 X 3 = 108
36 X 4 = 144
36 X 5 = 180
36 X 6 = 216
36 X 7 = 252
36 X 8 = 288
36 X 9 = 324
36 X 10 = 360
*/
//Ejercicio 1
let nameReto : [Character] = ["A", "l", "e", "x", "a", "n", "d", "e", "r"," "]
let exclamationReto : Character =  "\u{1F1F5}\u{1F1EA}"
var nameStringReto = String(nameReto)
nameStringReto.append(exclamationReto)
print(nameStringReto)


//Ejercicio 2
for i in 0...10{
    print("Numero: 2 * \(i) es = \(i*3)"  )
}
let myName : [Character] = ["L", "u", "i", "s", " ", "A", "l", "b", "e", "r", "t", "o"]

let myNameString = String(myName)

print("Hola mi nombre es \(myNameString) y esta hecho a partir de un array de caracteres")


let number: Int = 4

for i in 0...9 {
    let count = i + 1
    let result = count * number
    print("El resultado de \(number) * \(count) es \(result)")
//RETO 1
let nameChars : [Character] = ["D","a","v","i","d","\u{1F1FB}\u{1F1EA}"]
var nameString = String(nameChars)
print(nameString)

//RETO 2
let five = 5
for i in 0...10 {
    print("\(five) * \(i) = \(five * i)")
}

Curiosamente en la clase pasada me puse a explorar todas estas funciones de los String y ya estaba jugando con ellas, y en esta clase me encuentro con el profesor las esta explicando, que Genial me ha parecido la clase!

Reto 2:

let myNumberInTable = 5

for multiplication in 0...10 // Rango Abierto
{
    print("\(myNumberInTable) * \(multiplication) = \(myNumberInTable * multiplication)")
}

Reto 1:

let myUsernameInCharacters : [Character] = ["n", "i", "x"]
let myFlag = "\u{1F1F2}\u{1F1FD}"
let myUsernameInStringNOW = String(myUsernameInCharacters)

let exclamation1 : Character = "隆"
let exclamation2 : Character = "!"

var myRegards = String()

myRegards.append(exclamation1)
myRegards.append("Holaaa")
myRegards.append(exclamation2)
myRegards.append(", mi nombre de usario es \"\(myUsernameInStringNOW)\" y soy de \(myFlag)")

print(myRegards)
//Reto1
let myNameChars: [Character] = ["D","a","v","i","d"]
var myNameString = String(myNameChars)
myNameString.append(flag)

//Reto2
let multiplieer = 5
for i in 1...10{
    print("\(i) * \(multiplieer) = \(i * multiplieer)")
}```

let threeTable = 3

for i in 0鈥9 {
let count = i+1
let multiply = count * threeTable
print(count, 鈥*鈥, threeTable, multiply)
}

al final vi que la mayor铆a hizo el print de forma distinta, no se que tan bien se vea el m铆o haha cualquier comentario de critica constructiva se agradece!

//Reto 1
let country = "\u{1F1F2}\u{1F1FD}"
var myName = "Edgar"
myName.append(country)

//Reto 2
let num = 7
for i in 1鈥10 {
print("(num) * (i) = (num * i)")
}