Questions tagged as 'python-3.x'

1
answer

How to use the conditions with the contents of a txt file in python [closed]

data = open("archivo.txt", "r") o_data = data.readlines() data.close() if "hola" == o_data[2]: print("si") else: print("no") The problem is that I do not know if the word hello is equal to the hello that is written in the file. Thanks...
asked by 05.08.2017 / 19:17
2
answers

Random about a CSV in python?

I want to get a row randomly from the 31 that my CSV file contains. This is my code: import csv import random path="/home/eocampo/Escritorio/porque_pregunta_6.csv" file=open(path,newline='') reader=csv.reader(file) data=[row for row...
asked by 25.05.2018 / 17:19
1
answer

that I must modify since it tells me that it is out of range in python

# -*- coding: utf-8 -*- import csv class Contact: def __init__(self, name, phone, email): self.name = name self.phone = phone self.email = email class Agenda: def __init__(self): self._contacts = []...
asked by 22.08.2018 / 21:25
1
answer

solve list of names python bubble method

Good I have a job to do programming in python I have half finished but I need help with the bubble method to order a list of alphabetically given nonbres by the user I have the part of the list asking the user the names eh print them but the bub...
asked by 01.11.2016 / 17:57