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
ale4655 [162]
3 years ago
15

Write a program that initializes a string variable and prints the first three characters, followed by three periods, and then th

e last three characters. For example, if the string is initialized to "Mississippi", then print Mis...ppi.
Computers and Technology
1 answer:
d1i1m1o1n [39]3 years ago
8 0

firstly we have to initialize the variable, means to give variable a value and then print the statement

string = "fahadisahadam"

print(string[:3]+"..."+string[-3:])

string is a data type that contains two or more characters.

means the string is fahadisahadam so the print will print first three characters. follow by three periods(...) and then last three characters.

The output will be:

fah...dam

You might be interested in
"Write an iterative function iterPower(base, exp) that calculates the exponential baseexp by simply using successive multiplicat
sp2606 [1]

Answer:

I am writing the function using Python. Let me know if you want the program in some other programming language.            

def iterPower(base, exp):    

    baseexp = 1

    while exp > 0:

        baseexp = baseexp*base

        exp= exp - 1

    return baseexp

base = 3

exp = 2

print(iterPower(base, exp))

Explanation:

  • The function name is iterPower which takes two parameters base and exp. base variable here is the number which is being multiplied and this number is multiplied exponential times which is specified in exp variable.
  • baseexp is a variable that stores the result and then returns the result of successive multiplication.
  • while loop body keeps executing until the value of exp is greater than 0. So it will keep doing successive multiplication of the base, exp times until value of exp becomes 0.
  • The baseexp keeps storing the multiplication of the base and exp keeps decrements by 1 at each iteration until it becomes 0 which will break the loop and the result of successive multiplication stored in baseexp will be displayed in the output.
  • Here we gave the value of 3 to base and 2 to exp and then print(iterPower(base, exp)) statement calls the iterPower function which calculates the exponential of these given values.
  • Lets see how each iteration works:
  • 1st iteration

baseexp = 1

exp>0 True because exp=2 which is greater than 0

baseexp = baseexp*base

               = 1*3 = 3

So baseexp = 3

exp = exp - 1

      = 2 - 1 = 1    

exp = 1

  • 2nd iteration

baseexp = 3

exp>0 True because exp=1 which is greater than 0

baseexp = baseexp*base

               = 3*3 = 9

So baseexp = 9

exp = exp - 1

      = 1-1 = 0    

exp = 0

  • Here the loop will break now when it reaches third iteration because value of exp is 0 and the loop condition evaluates to false now.
  • return baseexp statement will return the value stored in baseexp which is 9
  • So the output of the above program is 9.
5 0
2 years ago
What is the best software for game design
riadik2000 [5.3K]

The 2D Design Engines

10. Sploder

This program should be labeled a product for the very novice of game designers and developers. It features a very simple interface that can be used to make shooters and platformers. The custom game, which Sploder creates, always comes out as flash, which is arguably one of the best places to start anyway. It features a drag and drop interface, and your games can also be shared with other Sploder users, making it a community application.

9. RPG Maker XP

Yet another beginner program RPG Maker is well known all around the gaming community as an awesome place to start designing. It features many tropes of those old 16bit RPG games that were in the rage during the early 90’s. Along the way, the program usually holds your hand through the process of creating your world and story, which is also supplemented by countless FAQs and forums discussing the program.

8. Multimedia Fusion 2

For the fledgling designer who has more than a few games under their belt, Multimedia Fusion 2 is the next logical step in design. It contains and intricate system that details a lot of design when it comes to levels, characters, and actions. The design also allows for easy assignment of behaviors to objects, as everything can be done through dragging and a little bit of event planning. Overall, this is a powerful program that any designer should try out in the long run.

7. Construct Classic

Construct Classic shares a lot of the same tropes with easy to use designing software in that it is very easy to use. The classic version of this program boasts the ability to create Direct X titles with the addition of an awesome physics engine, even system, and fully realized pixel shader effects. The program is ideal for creating prototypes, but can also be used to make simple games.

6. Flixel

In terms of 2D game design, Flixel reigns supreme because of one very important fact. A created game with the Flixel engine can be distributed freely, with no need to purchase a license to distribute the said game. It also got one of the most supportive forums as the program is constantly updated with improved collision and even boxes, along with countless 2D objects.

The 3D Design Engines

5. UDK (Unreal Development Kit)

The Unreal Engine is an iconic design program, and there are tons of titles that prove the very same. It has been in use for so many years that no one can dispute how powerful it really is. At the same time, it’s a very good intermediate level design program, as it features a full 3D workspace where designs for levels and characters can all be made. Be forewarned though, this is a very professional program, and if you intend to create game, you’ll have to pay $100 plus royalties for each sale.

4. Blitz Max

For beginners that want to upgrade from 2D to 3D without too many hiccups, Blitz Max is the perfect tool to translate that journey. It features a very fundamental approach to 3D games design, buy at the same time, it doesn’t restrict the user in too many ways. In terms of graphical quality, don’t expect too much out of it as the aesthetics are based on the most fundamental designs.

3. Pygame

One of the reasons why Pygame is on this list is because it deals with the Python programming language. This makes it a very big contender as Python mostly belongs the PS3 format, and is a tricky language to master. However, this program, with the many countless tutorial books makes it easier to grasp every concept required in making games.

2. XNA Games Studio

XNA is the prime language you should pick if you’re really considering getting serious with games design and creation. The design program has countless different titles under its already well established repertoire, and that is still fast growing. However, you also have to be aware that the software is on the technical side of design, as you may see in games Spelunky or Magicka.

1. Unity3D

We can’t all be masters of programming languages, and certainly, not all of us have the ability to create game engines from scratch. This is basically the idea behind Unity 3D, and it upholds that same ideal very well because it takes a very hands-off approach to your design. There are many different tutorials on how you can get started on this engine, so starting now might be beneficial to you.

7 0
3 years ago
Read 2 more answers
After earning a learners license what test must be successfully passed to earn an operators license in Florida
Monica [59]
After earning a learners license , the <span>test that must be successfully passed to earn an operators license in Florida is: the driving skill test
The diriving skill test is a set of procedure that all learners must follow in order to determine the learners' ability in driving motor vehicle and test learner's understanding about traffic rules.</span>
5 0
3 years ago
How to drive more website traffic?
lidiya [134]

Hello there,

How to drive more website traffic?

Answer: Advertise

8 0
3 years ago
When you are making multiples of a brownie recipe, you cannot - without great difficulty - use a fraction of an egg. The calcula
Lera25 [3.4K]
The answer is one ☝️ question for the poll of a vote
5 0
2 years ago
Other questions:
  • What is a negative impact of digital communication
    6·1 answer
  • someone who protects valuable online information, like phone numbers and passwords would be considered​
    8·1 answer
  • Which of the following TCP/IP settings should be configured to specify DNS suffixes to use other than resolving names through a
    9·1 answer
  • Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
    11·1 answer
  • Help me plz What character must always be used when a formula is enter in a cell? (on a spreadsheet)​
    11·1 answer
  • Write a function that takes in two parallel lists: a list of times (in increasing order), and a list of distance traveled by tha
    13·1 answer
  • I am booooooored any one want to join
    5·2 answers
  • People’s personal information is collected _____. Select 4 options.
    7·2 answers
  • Why do relational databases use primary keys and foreign keys?.
    12·1 answer
  • The iso 14001:2004 standards require documentation of a firm's environmental program. Which component requires a plan to improve
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!