У нас вы можете посмотреть бесплатно Operators In Ruby: 6 Things (2 Min) You Need To Know или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this tutorial, you'll learn how to use operators in Ruby programming language. — Facebook: / gokcedbsql — Video Transcript: — Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn six things about operators in Ruby. Number one, ruby supports arithmetic operators such as plus-minus start forward slash, and double star. For example online eight, I'm using the percent operator to perform a modulus between a and b. On line nine, I'm using the double star operator to do a exponent b which is a to the power of b. Number two, you can also use comparison operators such as equal equal to not equal to, and greater than equal to. In this example on line 14, I'm checking whether the variable a is equal equal to b, and if it is print true else print false. Note the question mark colon is also known as the remarry operator and it follows the syntax of if condition is true question mark do x colon else do y. Number three, you can also use the assignment operators such as equal to plus equal to, and minus equal to. In this example, on line 21 I'm doing c plus equal to b which is equivalent to doing c equal to c plus b. Number four, Ruby also supports parallel assignment which means assigning multiple variables on a single line. On line 27, I'm assigning the values of 10 and 20 to a and b. On line 29, I'm swapping the values of a and b on a single line. Number five, you can also make use of dot dot and dot dot dot range operators in Ruby. On line 33 I'm using the dot dot operator to print the range from 1 to 5. Note, when you use three dots the end value is exclusive so line 34 won't print five. Last but not the least, number six. Use the define question mark operator to check whether a variable is defined or not. Line 38, will bring nil or empty because the variable x is undefined. There you have it. Make sure you like, subscribe, and turn on the notification bell. Until next time. Connect MySQL In Python: • How To Connect To MySQL In Python (2 Min) ... Run Selenium PyTests In Parallel: • How To Run Selenium PyTests In Parallel (2... Find_elements() in Selenium: • How To: Find_Elements() In Selenium (3 Min... — 1. Arithmetic Operators such as +, -, *, /, %, ** a = 6 b = 3 puts "1a. #{a+b}" puts "1b. #{a-b}" puts "1c. #{a*b}" puts "1d. #{a/b}" puts "1e. #{a%b}" # Modulus puts "1f. #{a**b}" # Exponent, a to the power b 2. Comparison Operators such as ==, !=, [removed]= a = 6 b = 3 a == b ? puts("2a. true") : puts("2a. false") # Ternary operator a != b ? puts("2b. true") : puts("2b. false") # If Condition is true ? Do X : Else Do Y a [removed]= b ? puts("2c. true") : puts("2c. false") 3. Assignment Operators such as =, +=, -= c = a + b puts("3a. #{c}") c += b puts("3b. #{c}") c -= b puts("3c. #{c}") 4. Parallel Assignment, multiple variables can be assigned on a single line a, b = 10, 20 puts("4a. #{a}, #{b}") a, b = b, a puts("4b. #{a}, #{b}") 5. Range Operators .. and ... puts("5a. #{(1..5).to_a}") puts("5b. #{(1...5).to_a}") # end value is exclusive 6. defined? Operator puts("6a. #{defined? a}") puts("6b. #{defined? x}") # nil means undefined