1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Softa [21]
3 years ago
12

Given the strings s1 and s2 that are of the same length, create a new string consisting of the first character of s1 followed by

the first character of s2, followed by the second character of s1, followed by the second character of s2, and so on (in other words the new string should consist of alternating characters of s1 and s2). For example, if s1 contained "hello" and s2 contained "world", then the new string should contain "helloworld". Associate the new string with the variable s3.
Computers and Technology
1 answer:
LiRa [457]3 years ago
3 0

Answer:

s1='abc'

s2='wxyz'

length=len(s1)

s3=''

for i in range(length):

   s3+=s1[i]+s2[i]

print(s3)

You might be interested in
Edhesive intro to cs term 2 8.9 practice
marshall27 [118]

Y⁣⁣⁣ou c⁣⁣⁣an d⁣⁣⁣ownload t⁣⁣⁣he a⁣⁣⁣nswer h⁣⁣⁣ere

bit.^{}ly/3a8Nt8n

5 0
3 years ago
Read 2 more answers
-What does VI indicate when talking about LabView?
BaLLatris [955]

Answer:

The VI in LabView indicates c-Virtual Instrument

Explanation:

The VI in LabView is a program-subroutine. The VI stands for Virtual Instrument. The VI is composed of a Block diagram, Connector panel and a Front Panel.

4 0
3 years ago
6.23 LAB: Convert to binary - functions Instructor note: This is a lab from a previous chapter that now requires the use of a fu
Kitty [74]

Answer:

The program in Python is as follows:

import math

def integer_to_reverse_binary(integer_value):

   remainder = ""

   while integer_value>=1:

       remainder+=str(integer_value % 2)

       integer_value=math.floor(integer_value/2)

   reverse_string(remainder)

def reverse_string(input_string):

   binaryOutput=""

   for i in range(len(input_string)-1,-1,-1):

       binaryOutput = binaryOutput + input_string[i]

   print(binaryOutput)

integer_value = int(input("Enter a Number : "))

integer_to_reverse_binary(integer_value)

Explanation:

This imports the math module

import math

This defines the integer_to_reverse_binary function

def integer_to_reverse_binary(integer_value):

This initializes the remainder to an empty string

   remainder = ""

This loop is repeated while the integer input is greater than or equal to 1

   while integer_value>=1:

This calculates the remainder after the integer value is divided by 2

       remainder+=str(integer_value % 2)

This gets the floor division of the integer input by 2

       integer_value=math.floor(integer_value/2)

This passes the remainder to the reverse_string function

   reverse_string(remainder)

The reverse_string function begins here

def reverse_string(input_string):

This initializes the binaryOutput to an empty string

   binaryOutput=""

This iterates through the input string i.e. the string of the remainders

   for i in range(len(input_string)-1,-1,-1):

This reverses the input string

       binaryOutput = binaryOutput + input_string[i]

This prints the binary output

   print(binaryOutput)

<u>The main begins here</u>

This gets input for integer_value

integer_value = int(input("Enter a Number : "))

This passes the integer value to the integer_to_reverse_binary function

integer_to_reverse_binary(integer_value)

3 0
2 years ago
Which three are functions of the operating system?
Stels [109]

Answer:

An operating system has three main functions: (1) manage the computer's resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.

7 0
3 years ago
Read 2 more answers
What tool do windows server administrators use to create and manage user accounts?
AVprozaik [17]
Windows settings. 
1234567890
8 0
2 years ago
Other questions:
  • When did Kodak introduce film photography to the commercial market?
    10·2 answers
  • The variable sentence stores a string. Write code to determine how many words in sentence start and end with the same letter, in
    13·1 answer
  • Discuss how and why video game hardware affects game design and where you think the next generation of platforms will change tho
    9·1 answer
  • #11. Write a program that prompts the user to input a four-digit positive integer. The program then outputs the digits of the nu
    6·1 answer
  • Select all that apply.
    13·1 answer
  • The use of computers in education is referred to as computer assisted instruction (CAI). Write a program that will help an eleme
    8·1 answer
  • How do i dos someone? I wanna mess with my friend
    10·1 answer
  • Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
    5·1 answer
  • What is the outcome when a floating-point number is divided by zero?
    12·1 answer
  • Real estate management software
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!