No tienes acceso a esta clase

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

Characters

10/33
Recursos

Aportes 54

Preguntas 2

Ordenar por:

Los aportes, preguntas y respuestas son vitales para aprender en comunidad. Reg铆strate o inicia sesi贸n para participar.

(

//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)
}

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)")
}
//Ejercicio
var nameCharacter:[Character] = ["M","i","g","u","e","l"]
var flag = " \u{1F1FB}"
var informationUser : String = String(nameCharacter)
informationUser.append(flag)

var range = 0...10
for num in range {
    print("5 x \(num) = \(5*num)")
}```
// 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)")
}