Konu Sahibi: Mango, Kategori: Python, Mesajlar: 0 , Okunma: 120

Python Sahte Alıntı Oluşturucu Yapımı

#1
Döküman 
Merhaba,
Belirlenen metni noktalardan parçalayıp içinden verilen sayı kadar rastgele cümle alıp ekrana yazıyor.

Kullanılan modüller: random


Kod:
import random

# source: http://en.wikipedia.org/wiki/Python_%28programming_language%29
sentences = "Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library. Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller,[24] Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, allowing for the distribution of Python-based software for use on those environments without requiring the installation of a Python interpreter. CPython, the reference implementation of Python, is free and open-source software and has a community-based development model, as do nearly all of its alternative implementations. CPython is managed by the non-profit Python Software Foundation.".split(".")

print(("-" * 30) + "\nPseudo Quote Generator\n" + ("-" * 30))

n = int(raw_input("Number of sentences: "))

quote = []

for i in range(n):
    quote.append(random.choice(sentences))

print("Your pseudo quote: {}.".format(".".join(quote)))
Bul
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
Python İle Neler Yapılabilir? şenol 2 66 06-10-2021 Saat 21:38
Son Yorum: uzman
Python Kurulumu Nasıl Yapılır? şenol 1 143 18-08-2021 Saat 23:42
Son Yorum: uzman
Profesyonel Bir Python Geliştiricisinin Neleri Bilmesi Gerekir? Mango 0 136 17-04-2021 Saat 14:26
Son Yorum: Mango
Python Şifre Girişi Sorgulatma Mango 0 120 14-04-2021 Saat 18:37
Son Yorum: Mango
Python Metni Geriye çevirme Mango 0 117 14-04-2021 Saat 18:35
Son Yorum: Mango

Hızlı Menü:


Konuyu Okuyanlar: 1 Ziyaretçi

ForumTeams